1
0
mirror of https://github.com/libssh2/libssh2.git synced 2026-01-27 00:18:12 +03:00

kex: missing free() when random data cannot be generated (#1780)

If random cannot be generated the allocated data must be freed.
This commit is contained in:
Lars Nordin
2026-01-14 21:23:52 +01:00
committed by GitHub
parent 0cb8351494
commit ae0a231650

View File

@@ -3382,6 +3382,7 @@ static int kexinit(LIBSSH2_SESSION * session)
*(s++) = SSH_MSG_KEXINIT;
if(_libssh2_random(s, 16)) {
LIBSSH2_FREE(session, data);
return _libssh2_error(session, LIBSSH2_ERROR_RANDGEN,
"Unable to get random bytes "
"for KEXINIT cookie");