X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fubus.git;a=blobdiff_plain;f=ubusd_obj.c;fp=ubusd_obj.c;h=62c2331c50aba30be8258ffbcb53816f773a8a67;hp=8923821e0827fe3fb904ae57e212ed7cc33f0016;hb=7798d56301b7264cbcea0a6a9225a210154c693a;hpb=2d660c519d2fcff95248da9f4fd9b37d61f9eb09;ds=sidebyside diff --git a/ubusd_obj.c b/ubusd_obj.c index 8923821..62c2331 100644 --- a/ubusd_obj.c +++ b/ubusd_obj.c @@ -58,6 +58,9 @@ static struct ubus_object_type *ubus_create_obj_type(struct blob_attr *sig) int rem; type = calloc(1, sizeof(*type)); + if (!type) + return NULL; + type->refcount = 1; if (!ubus_alloc_id(&obj_types, &type->id, 0))