From 1df0af76700c7f75ea43006ad6d450cdeeb6244f Mon Sep 17 00:00:00 2001 From: Alexey Fomenko Date: Wed, 2 Mar 2011 04:13:21 +0100 Subject: don't leak malloced variables in the loop; remove double alloc Signed-off-by: Alexey Fomenko Signed-off-by: Denys Vlasenko --- networking/ifupdown.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'networking/ifupdown.c') diff --git a/networking/ifupdown.c b/networking/ifupdown.c index 59df4e80f..c7b560bf8 100644 --- a/networking/ifupdown.c +++ b/networking/ifupdown.c @@ -1220,13 +1220,13 @@ int ifupdown_main(int argc UNUSED_PARAM, char **argv) /* ifup */ if (iface_state) { bb_error_msg("interface %s already configured", iface); - continue; + goto next; } } else { /* ifdown */ if (!iface_state) { bb_error_msg("interface %s not configured", iface); - continue; + goto next; } } llist_free(state_list, free); @@ -1316,6 +1316,9 @@ int ifupdown_main(int argc UNUSED_PARAM, char **argv) fclose(state_fp); llist_free(state_list, free); } + next: + free(iface); + free(liface); } return any_failures; -- cgit v1.2.3