1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-12-12 15:41:16 +03:00

getpass: Fix a memory leak in ssh_gets() on error.

This commit is contained in:
Andreas Schneider
2012-10-05 11:10:47 +02:00
parent 22f607649d
commit 6092596199

View File

@@ -62,6 +62,7 @@ static int ssh_gets(const char *prompt, char *buf, size_t len, int verify) {
} }
fflush(stdout); fflush(stdout);
if (fgets(tmp, len, stdin) == NULL) { if (fgets(tmp, len, stdin) == NULL) {
free(tmp);
return 0; return 0;
} }