mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-12 03:00:26 +09:00
socket: Free poll handle when resetting socket state
Since 07cb0be12 we are not closing the user provided FDs,
but the above change also resulted in memory leak during
ssh_disconnect that left the poll_handle allocated during
reset.
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
@@ -202,7 +202,10 @@ void ssh_socket_reset(ssh_socket s)
|
|||||||
s->read_wontblock = 0;
|
s->read_wontblock = 0;
|
||||||
s->write_wontblock = 0;
|
s->write_wontblock = 0;
|
||||||
s->data_except = 0;
|
s->data_except = 0;
|
||||||
s->poll_handle = NULL;
|
if (s->poll_handle != NULL) {
|
||||||
|
ssh_poll_free(s->poll_handle);
|
||||||
|
s->poll_handle = NULL;
|
||||||
|
}
|
||||||
s->state=SSH_SOCKET_NONE;
|
s->state=SSH_SOCKET_NONE;
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
s->proxy_pid = 0;
|
s->proxy_pid = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user