aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2012-10-05 11:10:47 +0200
committerAndreas Schneider <asn@cryptomilk.org>2012-10-05 11:12:14 +0200
commit6092596199e8ebfbbf6e6ba48b7ec6ca0d85fa13 (patch)
treebe28cb2bd1704453686cd5a33fab07d5f62d4bb5 /src
parent22f607649d7dc530df84b7b90781ce0b88153095 (diff)
downloadlibssh-6092596199e8ebfbbf6e6ba48b7ec6ca0d85fa13.tar.gz
libssh-6092596199e8ebfbbf6e6ba48b7ec6ca0d85fa13.tar.xz
libssh-6092596199e8ebfbbf6e6ba48b7ec6ca0d85fa13.zip
getpass: Fix a memory leak in ssh_gets() on error.
Diffstat (limited to 'src')
-rw-r--r--src/getpass.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/getpass.c b/src/getpass.c
index 0bb6a9a9..4d3a4049 100644
--- a/src/getpass.c
+++ b/src/getpass.c
@@ -62,6 +62,7 @@ static int ssh_gets(const char *prompt, char *buf, size_t len, int verify) {
}
fflush(stdout);
if (fgets(tmp, len, stdin) == NULL) {
+ free(tmp);
return 0;
}