int ret;
*ocistate = NULL;
- asprintf(&objname, "container.%s", name);
+ if (asprintf(&objname, "container.%s", name) == -1)
+ exit(ENOMEM);
+
ret = ubus_lookup_id(ctx, objname, &id);
free(objname);
if (ret)
char *objname;
unsigned int id;
- asprintf(&objname, "container.%s", name);
+ if (asprintf(&objname, "container.%s", name) == -1)
+ return ENOMEM;
+
if (ubus_lookup_id(ctx, objname, &id))
return ENOENT;
blobmsg_add_u32(&req, "signal", signal);
blobmsg_add_string(&req, "name", name);
- asprintf(&objname, "container.%s", name);
+ if (asprintf(&objname, "container.%s", name) == -1)
+ return ENOMEM;
+
ret = ubus_lookup_id(ctx, objname, &id);
free(objname);
if (ret)
if (ret && errno != EEXIST)
return ret;
- if (asprintf(&fname, "%s/%s.json", UXC_CONFDIR, name) < 1)
+ if (asprintf(&fname, "%s/%s.json", UXC_CONFDIR, name) == -1)
return ENOMEM;
f = open(fname, O_WRONLY | O_CREAT | O_TRUNC, 0644);