From fa2403def21b7a5892e74148d931ca767d7f6d4a Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Mon, 26 Nov 2018 09:45:47 +0100 Subject: config: fix resource leaks on error in config_parse_interface() Signed-off-by: Hans Dedecker --- config.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'config.c') 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; -- cgit v1.2.3