1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 17:38:00 +00:00

PSFTP: fix memory leak opening two consecutive sessions.

Testing the script described in the previous commit message, Leak
Sanitiser pointed out that we didn't free the LogContext from the
first connection, and overwrote the pointer variable with the one from
the second.
This commit is contained in:
Simon Tatham 2023-06-07 07:14:29 +01:00
parent 6370782de7
commit 05a6699939

View File

@ -2386,6 +2386,10 @@ static void do_sftp_cleanup(void)
sfree(homedir); sfree(homedir);
homedir = NULL; homedir = NULL;
} }
if (psftp_logctx) {
log_free(psftp_logctx);
psftp_logctx = NULL;
}
} }
int do_sftp(int mode, int modeflags, char *batchfile) int do_sftp(int mode, int modeflags, char *batchfile)