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:
@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user