Blame SOURCES/wget-1.21-segfault.patch

31786d
diff --git a/src/ftp.c b/src/ftp.c
31786d
index ea7621e0..ab6802a6 100644
31786d
--- a/src/ftp.c
31786d
+++ b/src/ftp.c
31786d
@@ -992,9 +992,6 @@ Error in server response, closing control connection.\n"));
31786d
 
31786d
           /* 2004-09-20 SMS. */
31786d
 
31786d
-          if (target != targetbuf)
31786d
-            xfree (target);
31786d
-
31786d
         } /* else */
31786d
     }
31786d
   else /* do not CWD */
31786d
diff --git a/src/ftp.c b/src/ftp.c
31786d
index a1fcaa50..e821b0f3 100644
31786d
--- a/src/ftp.c
31786d
+++ b/src/ftp.c
31786d
@@ -2083,7 +2083,7 @@ ftp_loop_internal (struct url *u, struct url *original_url, struct fileinfo *f,
31786d
             /* --dont-remove-listing was specified, so do count this towards the
31786d
                number of bytes and files downloaded. */
31786d
             {
31786d
-              total_downloaded_bytes += qtyread;
31786d
+              total_downloaded_bytes += (qtyread - restval);
31786d
               numurls++;
31786d
             }
31786d
 
31786d
@@ -2098,7 +2098,7 @@ ftp_loop_internal (struct url *u, struct url *original_url, struct fileinfo *f,
31786d
              downloaded if they're going to be deleted.  People seeding proxies,
31786d
              for instance, may want to know how many bytes and files they've
31786d
              downloaded through it. */
31786d
-          total_downloaded_bytes += qtyread;
31786d
+          total_downloaded_bytes += (qtyread - restval);
31786d
           numurls++;
31786d
 
31786d
           if (opt.delete_after && !input_file_url (opt.input_filename))