1
0
mirror of https://github.com/libssh2/libssh2.git synced 2025-11-23 01:22:37 +03:00

Fixed a few memory leaks in error paths

This commit is contained in:
Dan Fandrich
2014-02-18 23:34:31 +01:00
parent 5559ad8fe1
commit 92d686fe19
3 changed files with 11 additions and 0 deletions

View File

@@ -1016,6 +1016,14 @@ session_free(LIBSSH2_SESSION *session)
if (session->scpSend_command) {
LIBSSH2_FREE(session, session->scpSend_command);
}
if (session->sftpInit_sftp) {
LIBSSH2_FREE(session, session->sftpInit_sftp);
}
/* Free payload buffer */
if (session->packet.total_num) {
LIBSSH2_FREE(session, session->packet.payload);
}
/* Cleanup all remaining packets */
while ((pkg = _libssh2_list_first(&session->packets))) {