X-Git-Url: http://git.openwrt.org/?a=blobdiff_plain;f=ubusd_proto.c;h=b591384283ed0669e3b2f0234ec11c31a2c3f74f;hb=fd61773031402728098800c67f38f83ee04977ad;hp=0624574925603a1cd7b265e33d42aef88774b9b3;hpb=b405050ceb53a0f7fce5a3e0958b6e5406e9225b;p=project%2Fubus.git diff --git a/ubusd_proto.c b/ubusd_proto.c index 0624574..b591384 100644 --- a/ubusd_proto.c +++ b/ubusd_proto.c @@ -130,8 +130,8 @@ static int ubusd_handle_remove_object(struct ubus_client *cl, struct ubus_msg_bu if (obj->type && obj->type->refcount == 1) blob_put_int32(&b, UBUS_ATTR_OBJTYPE, obj->type->id.id); - ubusd_free_object(obj); ubus_proto_send_msg_from_blob(cl, ub, UBUS_MSG_DATA); + ubusd_free_object(obj); return 0; } @@ -377,7 +377,7 @@ static int ubusd_handle_add_watch(struct ubus_client *cl, struct ubus_msg_buf *u return UBUS_STATUS_INVALID_ARGUMENT; target = ubusd_find_object(blob_get_u32(attr[UBUS_ATTR_TARGET])); - if (!target) + if (!target || !target->client) return UBUS_STATUS_NOT_FOUND; if (cl == target->client)