diff options
Diffstat (limited to 'networking/wget.c')
-rw-r--r-- | networking/wget.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/networking/wget.c b/networking/wget.c index eca673a86..24b0d93c8 100644 --- a/networking/wget.c +++ b/networking/wget.c | |||
@@ -552,6 +552,7 @@ static void download_one_url(const char *url) | |||
552 | FILE *dfp; /* socket to ftp server (data) */ | 552 | FILE *dfp; /* socket to ftp server (data) */ |
553 | char *proxy = NULL; | 553 | char *proxy = NULL; |
554 | char *fname_out_alloc; | 554 | char *fname_out_alloc; |
555 | char *redirected_path = NULL; | ||
555 | struct host_info server; | 556 | struct host_info server; |
556 | struct host_info target; | 557 | struct host_info target; |
557 | 558 | ||
@@ -794,8 +795,8 @@ However, in real world it was observed that some web servers | |||
794 | bb_error_msg_and_die("too many redirections"); | 795 | bb_error_msg_and_die("too many redirections"); |
795 | fclose(sfp); | 796 | fclose(sfp); |
796 | if (str[0] == '/') { | 797 | if (str[0] == '/') { |
797 | free(target.allocated); | 798 | free(redirected_path); |
798 | target.path = target.allocated = xstrdup(str+1); | 799 | target.path = redirected_path = xstrdup(str+1); |
799 | /* lsa stays the same: it's on the same server */ | 800 | /* lsa stays the same: it's on the same server */ |
800 | } else { | 801 | } else { |
801 | parse_url(str, &target); | 802 | parse_url(str, &target); |
@@ -850,6 +851,7 @@ However, in real world it was observed that some web servers | |||
850 | free(server.allocated); | 851 | free(server.allocated); |
851 | free(target.allocated); | 852 | free(target.allocated); |
852 | free(fname_out_alloc); | 853 | free(fname_out_alloc); |
854 | free(redirected_path); | ||
853 | } | 855 | } |
854 | 856 | ||
855 | int wget_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 857 | int wget_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |