summaryrefslogtreecommitdiff
path: root/networking
diff options
context:
space:
mode:
authorDenys Vlasenko2012-02-04 19:55:27 +0100
committerDenys Vlasenko2012-02-04 19:55:27 +0100
commitf99811908419608e3ab81393d0177cc456101e4b (patch)
tree11793447075d012f20bcd4bb1a8291d86f94520a /networking
parent1e98f3741c5a844c1d3d7966f20cd09dded05d0d (diff)
downloadbusybox-1_19_4.zip
busybox-1_19_4.tar.gz
Apply post-1.19.3 patches, bump version to 1.19.41_19_4
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking')
-rw-r--r--networking/wget.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/networking/wget.c b/networking/wget.c
index 6443705..fbb8a2e 100644
--- a/networking/wget.c
+++ b/networking/wget.c
@@ -552,6 +552,7 @@ static void download_one_url(const char *url)
FILE *dfp; /* socket to ftp server (data) */
char *proxy = NULL;
char *fname_out_alloc;
+ char *redirected_path = NULL;
struct host_info server;
struct host_info target;
@@ -794,8 +795,8 @@ However, in real world it was observed that some web servers
bb_error_msg_and_die("too many redirections");
fclose(sfp);
if (str[0] == '/') {
- free(target.allocated);
- target.path = target.allocated = xstrdup(str+1);
+ free(redirected_path);
+ target.path = redirected_path = xstrdup(str+1);
/* lsa stays the same: it's on the same server */
} else {
parse_url(str, &target);
@@ -850,6 +851,7 @@ However, in real world it was observed that some web servers
free(server.allocated);
free(target.allocated);
free(fname_out_alloc);
+ free(redirected_path);
}
int wget_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;