config: fix resource leaks on error in config_parse_interface()
authorHans Dedecker <dedeckeh@gmail.com>
Mon, 26 Nov 2018 08:45:47 +0000 (09:45 +0100)
committerHans Dedecker <dedeckeh@gmail.com>
Mon, 26 Nov 2018 08:52:59 +0000 (09:52 +0100)
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
config.c

index a1267b09348d541fa57887fb7cac483d179cc6ac..be10379d55590f0fd124760fe4becaea56c4a9f1 100644 (file)
--- 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;