[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] poll: fix leak in ssh_poll_ctx_free


Hi,

Attached is a patch which I believe should address the memory
leak reported here: https://red.libssh.org/issues/128.


Thanks,
-Jon
From 7fd63204f88bb6aafd728fb40705ff1131d07326 Mon Sep 17 00:00:00 2001
From: Jon Simons <jon@xxxxxxxxxxxxx>
Date: Wed, 30 Oct 2013 18:18:32 -0700
Subject: [PATCH] poll: fix leak in ssh_poll_ctx_free

Fix a memory leak in 'ssh_poll_ctx_free': issue 'ssh_poll_free'
to remove the poll handle from its context and free it.

BUG: https://red.libssh.org/issues/128
---
 src/poll.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/poll.c b/src/poll.c
index bde0198..a254aad 100644
--- a/src/poll.c
+++ b/src/poll.c
@@ -450,7 +450,7 @@ void ssh_poll_ctx_free(ssh_poll_ctx ctx) {
   if (ctx->polls_allocated > 0) {
     while (ctx->polls_used > 0){
       ssh_poll_handle p = ctx->pollptrs[0];
-      ssh_poll_ctx_remove(ctx, p);
+      ssh_poll_free(p);
     }
 
     SAFE_FREE(ctx->pollptrs);
-- 
1.8.4.21.g992c386


Follow-Ups:
Re: [PATCH] poll: fix leak in ssh_poll_ctx_freeAndreas Schneider <asn@xxxxxxxxxxxxxx>
Archive administrator: postmaster@lists.cynapses.org