Skip to content
Permalink
Browse files

restored free of server_hostkey

lost it in the shuffle.
  • Loading branch information...
willco007 committed Apr 24, 2019
1 parent 67233ae commit 0e285abd2e7d1bd19598de37003176a03cb53539
Showing with 6 additions and 0 deletions.
  1. +6 −0 src/kex.c
@@ -269,6 +269,9 @@ static int diffie_hellman_sha1(LIBSSH2_SESSION *session,
buf.dataptr = buf.data;
buf.dataptr++; /* advance past type */

if(session->server_hostkey)
LIBSSH2_FREE(session, session->server_hostkey);

if(_libssh2_copy_string(session, &buf, &(session->server_hostkey),
&host_key_len)) {
ret = _libssh2_error(session, LIBSSH2_ERROR_ALLOC,
@@ -957,6 +960,9 @@ static int diffie_hellman_sha256(LIBSSH2_SESSION *session,
buf.dataptr = buf.data;
buf.dataptr++; /* advance past type */

if(session->server_hostkey)
LIBSSH2_FREE(session, session->server_hostkey);

if(_libssh2_copy_string(session, &buf, &(session->server_hostkey),
&host_key_len)) {
ret = _libssh2_error(session, LIBSSH2_ERROR_ALLOC,

0 comments on commit 0e285ab

Please sign in to comment.
You can’t perform that action at this time.