summaryrefslogtreecommitdiffhomepage
path: root/config.c
diff options
context:
space:
mode:
authorHans Dedecker <dedeckeh@gmail.com>2018-11-26 09:45:47 +0100
committerHans Dedecker <dedeckeh@gmail.com>2018-11-26 09:52:59 +0100
commitfa2403def21b7a5892e74148d931ca767d7f6d4a (patch)
treec02461e82f63bfede2743920703ce29e45723f1e /config.c
parent85de9def885fee6335a526bc2b3b733e1f6b7014 (diff)
config: fix resource leaks on error in config_parse_interface()
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Diffstat (limited to 'config.c')
-rw-r--r--config.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/config.c b/config.c
index a1267b0..be10379 100644
--- a/config.c
+++ b/config.c
@@ -120,7 +120,8 @@ config_parse_interface(struct uci_section *s, bool alias)
if (!interface_add_alias(iface, config))
goto error_free_config;
} else {
- interface_add(iface, config);
+ if (!interface_add(iface, config))
+ goto error_free_config;
}
return;