Browse Source

config: fix resource leaks on error in config_parse_interface()

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Hans Dedecker 5 years ago
parent
commit
fa2403def2
1 changed files with 2 additions and 1 deletions
  1. 2 1
      config.c

+ 2 - 1
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;