diff options
Diffstat (limited to 'networking/traceroute.c')
-rw-r--r-- | networking/traceroute.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/networking/traceroute.c b/networking/traceroute.c index e9df275..6a53734 100644 --- a/networking/traceroute.c +++ b/networking/traceroute.c @@ -1001,17 +1001,11 @@ int traceroute_main(int argc, char **argv) #if ENABLE_FEATURE_TRACEROUTE_SOURCE_ROUTE if (source_route_list) { - llist_t *l_sr; - - l_sr = source_route_list; - while (l_sr) { + while (source_route_list) { if (lsrr >= NGATEWAYS) bb_error_msg_and_die("no more than %d gateways", NGATEWAYS); - getaddr(gwlist + lsrr, l_sr->data); + getaddr(gwlist + lsrr, llist_pop(&source_route_list)); ++lsrr; - l_sr = l_sr->link; - free(source_route_list); - source_route_list = l_sr; } optlen = (lsrr + 1) * sizeof(gwlist[0]); } |