mirror of https://github.com/mirror/busybox.git
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>1_19_stable
parent
940c7206c2
commit
1df0af7670
|
@ -1220,13 +1220,13 @@ int ifupdown_main(int argc UNUSED_PARAM, char **argv)
|
||||||
/* ifup */
|
/* ifup */
|
||||||
if (iface_state) {
|
if (iface_state) {
|
||||||
bb_error_msg("interface %s already configured", iface);
|
bb_error_msg("interface %s already configured", iface);
|
||||||
continue;
|
goto next;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* ifdown */
|
/* ifdown */
|
||||||
if (!iface_state) {
|
if (!iface_state) {
|
||||||
bb_error_msg("interface %s not configured", iface);
|
bb_error_msg("interface %s not configured", iface);
|
||||||
continue;
|
goto next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
llist_free(state_list, free);
|
llist_free(state_list, free);
|
||||||
|
@ -1316,6 +1316,9 @@ int ifupdown_main(int argc UNUSED_PARAM, char **argv)
|
||||||
fclose(state_fp);
|
fclose(state_fp);
|
||||||
llist_free(state_list, free);
|
llist_free(state_list, free);
|
||||||
}
|
}
|
||||||
|
next:
|
||||||
|
free(iface);
|
||||||
|
free(liface);
|
||||||
}
|
}
|
||||||
|
|
||||||
return any_failures;
|
return any_failures;
|
||||||
|
|
|
@ -156,7 +156,7 @@ int nameif_main(int argc, char **argv)
|
||||||
|
|
||||||
if (argc) {
|
if (argc) {
|
||||||
while (*argv) {
|
while (*argv) {
|
||||||
char *ifname = xstrdup(*argv++);
|
char *ifname = *argv++;
|
||||||
prepend_new_eth_table(&clist, ifname, *argv++);
|
prepend_new_eth_table(&clist, ifname, *argv++);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue