Two small memory leaks, also noticed by Martin Prikryl.
[u/mdw/putty] / scp.c
diff --git a/scp.c b/scp.c
index 70f13be..5e98536 100644 (file)
--- a/scp.c
+++ b/scp.c
@@ -466,6 +466,8 @@ static void print_stats(char *name, unsigned long size, unsigned long done,
 
        if (done == size)
            printf("\n");
+
+       fflush(stdout);
     }
 }
 
@@ -2176,6 +2178,12 @@ int psftp_main(int argc, char *argv[])
     if (gui_mode)
        gui_send_errcount(list, errs);
 
+    cmdline_cleanup();
+    console_provide_logctx(NULL);
+    back->free(backhandle);
+    backhandle = NULL;
+    back = NULL;
+    sk_cleanup();
     return (errs == 0 ? 0 : 1);
 }