1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-11-30 13:01:23 +03:00

auth: Cleanup memory leak when using SSH agent

In Cockpit we've seen this memory leak:

at 0x4C2A9C7: calloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
by 0x5B76B03: ssh_userauth_agent (auth.c:778)
by 0x40DD5A: cockpit_ssh_authenticate (cockpitsshtransport.c:327)

BUG: https://red.libssh.org/issues/208

Signed-off-by: Stef Walter <stefw@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Stef Walter
2015-11-10 12:18:30 +01:00
committed by Andreas Schneider
parent aa5c7c3b0c
commit ffe8b98cc2
3 changed files with 25 additions and 7 deletions

View File

@@ -261,6 +261,9 @@ void ssh_free(ssh_session session) {
ssh_list_free(session->opts.identity);
}
ssh_agent_state_free (session->agent_state);
session->agent_state = NULL;
SAFE_FREE(session->auth_auto_state);
SAFE_FREE(session->serverbanner);
SAFE_FREE(session->clientbanner);