mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-08-08 19:02:06 +03:00
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 Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
committed by
Andreas Schneider
parent
6c213c913b
commit
447ee309b0
@@ -450,7 +450,11 @@ 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);
|
||||
/*
|
||||
* The free function calls ssh_poll_ctx_remove() and decrements
|
||||
* ctx->polls_used
|
||||
*/
|
||||
ssh_poll_free(p);
|
||||
}
|
||||
|
||||
SAFE_FREE(ctx->pollptrs);
|
||||
|
Reference in New Issue
Block a user