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