[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] Fix leak of sftp->ext when sftp_new() fails
[Thread Prev] | [Thread Next]
- Subject: [PATCH] Fix leak of sftp->ext when sftp_new() fails
- From: Kevin Fan <kevinfan@xxxxxxxxxx>
- Reply-to: libssh@xxxxxxxxxx
- Date: Tue, 14 Apr 2015 11:40:04 -0700
- To: libssh@xxxxxxxxxx
Signed-off-by: Kevin Fan <kevinfan@xxxxxxxxxx> diff --git a/src/sftp.c b/src/sftp.c index d64d0ee..bd4a4b5 100644 --- a/src/sftp.c +++ b/src/sftp.c @@ -126,6 +126,7 @@ sftp_session sftp_new(ssh_session session){ sftp->session = session; sftp->channel = ssh_channel_new(session); if (sftp->channel == NULL) { + sftp_ext_free(sftp->ext); SAFE_FREE(sftp); return NULL; @@ -133,6 +134,7 @@ sftp_session sftp_new(ssh_session session){ if (ssh_channel_open_session(sftp->channel)) { ssh_channel_free(sftp->channel); + sftp_ext_free(sftp->ext); SAFE_FREE(sftp); return NULL;
Archive administrator: postmaster@lists.cynapses.org