diff options
author | Hans Dedecker <dedeckeh@gmail.com> | 2018-11-26 09:59:52 +0100 |
---|---|---|
committer | Hans Dedecker <dedeckeh@gmail.com> | 2018-11-26 10:00:43 +0100 |
commit | a82a8f65e6e6caf0a4059f4258cccca0895becbf (patch) | |
tree | c871e3a29f8ae038f8ed2195c9dab8f7e7499687 | |
parent | fa2403def21b7a5892e74148d931ca767d7f6d4a (diff) |
netifd: fix resource leak on error in netifd_add_dynamic()
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
-rw-r--r-- | ubus.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -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; } |