diff options
author | Greg Ames <gregames@apache.org> | 2013-02-02 12:50:58 +0000 |
---|---|---|
committer | Greg Ames <gregames@apache.org> | 2013-02-02 12:50:58 +0000 |
commit | b151171860fe18dbede9e86ec1124e5d3bf4a8ba (patch) | |
tree | 58352005bfa332532069ae80b657e845c6d14c10 /poll | |
parent | 3e2fdb0079fdf2f6adaa391e6f2f050bcce227fb (diff) | |
download | apr-b151171860fe18dbede9e86ec1124e5d3bf4a8ba.tar.gz |
fix memory leak
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1441742 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poll')
-rw-r--r-- | poll/unix/z_asio.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/poll/unix/z_asio.c b/poll/unix/z_asio.c index 6d58fa118..ce158d316 100644 --- a/poll/unix/z_asio.c +++ b/poll/unix/z_asio.c @@ -63,7 +63,7 @@ struct apr_pollset_private_t apr_thread_mutex_t *ring_lock; #endif - /* A hash of all active elements used for O(1) garbage collection */ + /* A hash of all active elements used for O(1) _remove operations */ apr_hash_t *elems; APR_RING_HEAD(ready_ring_t, asio_elem_t) ready_ring; @@ -640,6 +640,15 @@ static apr_status_t asio_pollset_poll(apr_pollset_t *pollset, */ if (elem->state == ASIO_REMOVED) { + + /* + * async i/o is done since it was found on prior_ready + * the state says the caller is done with it too + * so recycle the elem + */ + + APR_RING_INSERT_TAIL(&(priv->free_ring), elem, + asio_elem_t, link); continue; /* do not re-add if it has been _removed */ } |