From: Hans Dedecker Date: Mon, 26 Nov 2018 08:59:52 +0000 (+0100) Subject: netifd: fix resource leak on error in netifd_add_dynamic() X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=a82a8f65e6e6caf0a4059f4258cccca0895becbf;p=oweals%2Fnetifd.git netifd: fix resource leak on error in netifd_add_dynamic() Signed-off-by: Hans Dedecker --- diff --git a/ubus.c b/ubus.c index f5e4997..14688c2 100644 --- a/ubus.c +++ b/ubus.c @@ -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; }