wget: fix SEGV with multiple urls and redirection
authorPere Orga <gotrunks@gmail.com>
Mon, 14 Feb 2011 22:56:07 +0000 (23:56 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Mon, 14 Feb 2011 22:56:07 +0000 (23:56 +0100)
Signed-off-by: Pere Orga <gotrunks@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
networking/wget.c

index 6c015dccca43f51a3b84d7094bab612de273f32d..cb169aba33e241fee1fe6b0d4cbb1fc2da07339c 100644 (file)
@@ -805,6 +805,7 @@ However, in real world it was observed that some web servers
                                        parse_url(str, &target);
                                        if (!use_proxy) {
                                                free(server.allocated);
+                                               server.allocated = NULL;
                                                server.host = target.host;
                                                /* strip_ipv6_scope_id(target.host); - no! */
                                                /* we assume remote never gives us IPv6 addr with scope id */