diff options
| author | Jon Simons <jon@jonsimons.org> | 2013-10-30 18:18:32 -0700 |
|---|---|---|
| committer | Andreas Schneider <asn@cryptomilk.org> | 2013-10-31 11:55:27 +0100 |
| commit | 447ee309b03ce2885deeb4b5d88083b359b21890 (patch) | |
| tree | dd3e6ac5573205c4fa124f7c2bf8a9444dff889c /src | |
| parent | 6c213c913bc0ea46d6669b7d6e4d5b69489d5dd3 (diff) | |
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>
Diffstat (limited to 'src')
| -rw-r--r-- | src/poll.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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); |
