1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-15 18:17:32 -05:00

Fix another giant batch of resource leaks. (Mostly memory, but there's

one missing fclose too.)

[originally from svn r9919]
This commit is contained in:
Simon Tatham
2013-07-14 10:46:07 +00:00
parent 896bb7c74d
commit ea301bdd9b
20 changed files with 70 additions and 19 deletions

View File

@ -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;
}