1
0
mirror of https://github.com/libssh2/libssh2.git synced 2025-11-21 14:00:51 +03:00

session_free: free more data to avoid memory leaks

This commit is contained in:
John Little
2010-07-01 19:56:06 +02:00
committed by Daniel Stenberg
parent c375e5e5ad
commit ef4c8718c2
2 changed files with 12 additions and 0 deletions

View File

@@ -1133,6 +1133,9 @@ static int kexinit(LIBSSH2_SESSION * session)
} else {
data = session->kexinit_data;
data_len = session->kexinit_data_len;
/* zap the variables to ensure there is NOT a double free later */
session->kexinit_data = NULL;
session->kexinit_data_len = 0;
}
rc = _libssh2_transport_write(session, data, data_len);