X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/b165006759a81e8ecc4e86e0540fd69343ea46e9..038ec85e825fc940c1387f64a88ae73b75f6822b:/unix/uxsftp.c diff --git a/unix/uxsftp.c b/unix/uxsftp.c index f68685a0..57f28416 100644 --- a/unix/uxsftp.c +++ b/unix/uxsftp.c @@ -565,6 +565,7 @@ char *ssh_sftp_get_cmdline(char *prompt, int no_fds_ok) ret = ssh_sftp_do_select(TRUE, no_fds_ok); if (ret < 0) { printf("connection died\n"); + sfree(buf); return NULL; /* woop woop */ } if (ret > 0) { @@ -575,10 +576,12 @@ char *ssh_sftp_get_cmdline(char *prompt, int no_fds_ok) ret = read(0, buf+buflen, 1); if (ret < 0) { perror("read"); + sfree(buf); return NULL; } if (ret == 0) { /* eof on stdin; no error, but no answer either */ + sfree(buf); return NULL; }