Check asprintf return value instead of checking for NULL-pointer.
Coverity CID:
1492158 Unchecked return value
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
ns_pid = new_ns_pid;
jail_name = new_jail_name;
- asprintf(&ubus_sock_dir, "/var/containers/ubus-%s", jail_name);
- if (!ubus_sock_dir) {
+ if (asprintf(&ubus_sock_dir, "/var/containers/ubus-%s", jail_name) == -1) {
ret = ENOMEM;
goto errout_dir;
}
- asprintf(&ubus_sock_path, "%s/ubus", ubus_sock_dir);
- if (!ubus_sock_path) {
+ if (asprintf(&ubus_sock_path, "%s/ubus", ubus_sock_dir) == -1) {
ret = ENOMEM;
goto errout_path;
}