diff options
author | Alexey Fomenko | 2011-03-02 04:13:21 +0100 |
---|---|---|
committer | Denys Vlasenko | 2011-03-02 04:13:21 +0100 |
commit | 1df0af76700c7f75ea43006ad6d450cdeeb6244f (patch) | |
tree | 62db1ada5ae9433213e94fd1ffbd643a4c5ff91f /networking/ifupdown.c | |
parent | 940c7206c2a4acb386ab47199a6c313c04387f3b (diff) | |
download | busybox-1df0af76700c7f75ea43006ad6d450cdeeb6244f.zip busybox-1df0af76700c7f75ea43006ad6d450cdeeb6244f.tar.gz |
don't leak malloced variables in the loop; remove double alloc
Signed-off-by: Alexey Fomenko <ext-alexey.fomenko@nokia.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking/ifupdown.c')
-rw-r--r-- | networking/ifupdown.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/networking/ifupdown.c b/networking/ifupdown.c index 59df4e8..c7b560b 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; |