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

session: Fixed a memory leak with session->bindaddr.

This commit is contained in:
Andreas Schneider
2010-09-07 17:30:10 +02:00
parent c1604eff08
commit 325cc4e395
2 changed files with 2 additions and 0 deletions

View File

@@ -725,6 +725,7 @@ int ssh_bind_accept(ssh_bind sshbind, ssh_session session) {
if (sshbind->bindaddr == NULL) if (sshbind->bindaddr == NULL)
session->bindaddr = NULL; session->bindaddr = NULL;
else { else {
SAFE_FREE(session->bindaddr);
session->bindaddr = strdup(sshbind->bindaddr); session->bindaddr = strdup(sshbind->bindaddr);
if (session->bindaddr == NULL) { if (session->bindaddr == NULL) {
privatekey_free(dsa); privatekey_free(dsa);

View File

@@ -164,6 +164,7 @@ void ssh_free(ssh_session session) {
SAFE_FREE(session->serverbanner); SAFE_FREE(session->serverbanner);
SAFE_FREE(session->clientbanner); SAFE_FREE(session->clientbanner);
SAFE_FREE(session->bindaddr);
SAFE_FREE(session->banner); SAFE_FREE(session->banner);
#ifdef WITH_PCAP #ifdef WITH_PCAP
if(session->pcap_ctx){ if(session->pcap_ctx){