Commit a82a8f65 authored by Hans Dedecker's avatar Hans Dedecker

netifd: fix resource leak on error in netifd_add_dynamic()

Signed-off-by: default avatarHans Dedecker <dedeckeh@gmail.com>
parent fa2403de
......@@ -143,16 +143,17 @@ netifd_add_dynamic(struct ubus_context *ctx, struct ubus_object *obj,
config = blob_memdup(msg);
if (!config)
goto error_free;
goto error;
if (!interface_add(iface, config))
goto error;
goto error_free_config;
return UBUS_STATUS_OK;
error_free:
free(iface);
error_free_config:
free(config);
error:
free(iface);
return UBUS_STATUS_UNKNOWN_ERROR;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment