aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2017-04-24 13:27:20 +0200
committerAndreas Schneider <asn@cryptomilk.org>2017-04-24 13:27:20 +0200
commit5eb41492c452081b95eecad374a3ddef73cd384c (patch)
tree18082e47f5ec8924c40e6a1cd5fa217c4c4a6a06
parentc78c6c654222d8049d48ffb3f36f185e91f76789 (diff)
downloadlibssh-5eb41492c452081b95eecad374a3ddef73cd384c.tar.gz
libssh-5eb41492c452081b95eecad374a3ddef73cd384c.tar.xz
libssh-5eb41492c452081b95eecad374a3ddef73cd384c.zip
messages: Do not leak memory if answeres had been allocated previously
Found by ozz-fuzz BUG: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1222 Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
-rw-r--r--src/messages.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/messages.c b/src/messages.c
index 199ec4cd..b953ee6d 100644
--- a/src/messages.c
+++ b/src/messages.c
@@ -1010,6 +1010,7 @@ SSH_PACKET_CALLBACK(ssh_packet_userauth_info_response){
goto error;
}
+ SAFE_FREE(session->kbdint->answers[i]);
session->kbdint->answers[i] = ssh_string_to_char(tmp);
ssh_string_free(tmp);
if (session->kbdint->answers[i] == NULL) {