diff options
author | Max Romanov <max.romanov@nginx.com> | 2020-08-07 15:06:18 +0300 |
---|---|---|
committer | Max Romanov <max.romanov@nginx.com> | 2020-08-07 15:06:18 +0300 |
commit | 78fd04adcf398a00549c4912f68eff77c94ab6c0 (patch) | |
tree | 872fccebbbb0d739cf5f9e881458036d6a40091c /src/nxt_router.c | |
parent | b0ff245ca8609686a42025af6241279e2b5d2163 (diff) | |
download | unit-78fd04adcf398a00549c4912f68eff77c94ab6c0.tar.gz unit-78fd04adcf398a00549c4912f68eff77c94ab6c0.tar.bz2 |
Fixing listen event connection leakage.
A connection object is allocated in advance for each listen event object to be
used for the established connection. This connection needs to be freed when the
listen event is destroyed.
Diffstat (limited to 'src/nxt_router.c')
-rw-r--r-- | src/nxt_router.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/nxt_router.c b/src/nxt_router.c index d4d037e1..b3e326d0 100644 --- a/src/nxt_router.c +++ b/src/nxt_router.c @@ -3178,6 +3178,10 @@ nxt_router_listen_event_release(nxt_task_t *task, nxt_listen_event_t *lev, nxt_debug(task, "listen event count: %D", lev->count); if (--lev->count == 0) { + if (lev->next != NULL) { + nxt_conn_free(task, lev->next); + } + nxt_free(lev); } |