diff options
author | Rob Landley <rob@landley.net> | 2006-03-01 16:39:45 +0000 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2006-03-01 16:39:45 +0000 |
commit | e7c43b66d74ee9902a6732122788a7a16bcfbf18 (patch) | |
tree | ebb8583e9e1265588592614c0b4878daded44125 /networking/ifupdown.c | |
parent | 93f2286e6e59dab5eed14b5912a79254031c5a62 (diff) | |
download | busybox-w32-e7c43b66d74ee9902a6732122788a7a16bcfbf18.tar.gz busybox-w32-e7c43b66d74ee9902a6732122788a7a16bcfbf18.tar.bz2 busybox-w32-e7c43b66d74ee9902a6732122788a7a16bcfbf18.zip |
Cleanup patch from Denis Vlasenko. Mostly variants of removing the if(x)
from before "if(x) free(x)".
Diffstat (limited to 'networking/ifupdown.c')
-rw-r--r-- | networking/ifupdown.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/networking/ifupdown.c b/networking/ifupdown.c index 699fa7d06..156ceb7ab 100644 --- a/networking/ifupdown.c +++ b/networking/ifupdown.c | |||
@@ -1356,16 +1356,15 @@ extern int ifupdown_main(int argc, char **argv) | |||
1356 | } else { | 1356 | } else { |
1357 | /* Remove an interface from the linked list */ | 1357 | /* Remove an interface from the linked list */ |
1358 | if (iface_state) { | 1358 | if (iface_state) { |
1359 | /* This needs to be done better */ | 1359 | const llist_t *link = iface_state->link; |
1360 | free(iface_state->data); | 1360 | free(iface_state->data); |
1361 | free(iface_state->link); | 1361 | iface_state->data = NULL; |
1362 | if (iface_state->link) { | 1362 | iface_state->link = NULL; |
1363 | iface_state->data = iface_state->link->data; | 1363 | if (link) { |
1364 | iface_state->link = iface_state->link->link; | 1364 | iface_state->data = link->data; |
1365 | } else { | 1365 | iface_state->link = link->link; |
1366 | iface_state->data = NULL; | ||
1367 | iface_state->link = NULL; | ||
1368 | } | 1366 | } |
1367 | free(link); | ||
1369 | } | 1368 | } |
1370 | } | 1369 | } |
1371 | } | 1370 | } |