1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-11-29 01:03:57 +03:00

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>
This commit is contained in:
Andreas Schneider
2017-04-24 13:27:20 +02:00
parent c78c6c6542
commit 5eb41492c4

View File

@@ -1010,6 +1010,7 @@ SSH_PACKET_CALLBACK(ssh_packet_userauth_info_response){
goto error; goto error;
} }
SAFE_FREE(session->kbdint->answers[i]);
session->kbdint->answers[i] = ssh_string_to_char(tmp); session->kbdint->answers[i] = ssh_string_to_char(tmp);
ssh_string_free(tmp); ssh_string_free(tmp);
if (session->kbdint->answers[i] == NULL) { if (session->kbdint->answers[i] == NULL) {