mirror of https://github.com/wolfSSL/wolfssh.git
if a handshake info has a stored kex init message already before trying to store a kex init message, free it
parent
3653afac34
commit
c7a392d351
|
@ -6352,6 +6352,12 @@ int SendKexInit(WOLFSSH* ssh)
|
|||
|
||||
ssh->outputBuffer.length = idx;
|
||||
|
||||
if (ssh->handshake->kexInit != NULL) {
|
||||
WFREE(ssh->handshake->kexInit, ssh->ctx->heap, DYNTYPE_STRING);
|
||||
ssh->handshake->kexInit = NULL;
|
||||
ssh->handshake->kexInitSz = 0;
|
||||
}
|
||||
|
||||
buf = (byte*)WMALLOC(bufSz, ssh->ctx->heap, DYNTYPE_STRING);
|
||||
if (buf == NULL) {
|
||||
WLOG(WS_LOG_DEBUG, "Cannot allocate storage for KEX Init msg");
|
||||
|
|
Loading…
Reference in New Issue