mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-10 10:26:47 +09:00
getpass: Fix a memory leak in ssh_gets() on error.
(cherry picked from commit 6092596199)
This commit is contained in:
@@ -61,6 +61,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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user