summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2009-12-13 17:04:23 +0100
committerAris Adamantiadis <aris@0xbadc0de.be>2009-12-13 17:04:23 +0100
commit964d5f88cceca5134ad03822ad1b1c47669f7d5c (patch)
tree6d98e2f939483e520cf378314d77ff772aeba4f3
parentad7e9d88fbf36d0fdfb169cfa45c67d15da13263 (diff)
downloadlibssh-964d5f88cceca5134ad03822ad1b1c47669f7d5c.tar.gz
libssh-964d5f88cceca5134ad03822ad1b1c47669f7d5c.tar.xz
libssh-964d5f88cceca5134ad03822ad1b1c47669f7d5c.zip
ssh_poll_handle detaches from context before free
-rw-r--r--libssh/poll.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libssh/poll.c b/libssh/poll.c
index ac86750..f03f3d4 100644
--- a/libssh/poll.c
+++ b/libssh/poll.c
@@ -274,6 +274,10 @@ ssh_poll_handle ssh_poll_new(socket_t fd, short events, ssh_poll_callback cb,
*/
void ssh_poll_free(ssh_poll_handle p) {
+ if(p->ctx != NULL){
+ ssh_poll_ctx_remove(p->ctx,p);
+ p->ctx=NULL;
+ }
SAFE_FREE(p);
}