diff options
author | Max Romanov <max.romanov@nginx.com> | 2020-08-09 10:22:05 +0300 |
---|---|---|
committer | Max Romanov <max.romanov@nginx.com> | 2020-08-09 10:22:05 +0300 |
commit | 0f3abebd019130a6e4e69e53345f403ba802edfb (patch) | |
tree | 9b04960b22c527d1b54d018fe0c4157bca173bdf /src | |
parent | 91280b4c0b3ec0721a8f3ba09a1cc9f5ca56c238 (diff) | |
download | unit-0f3abebd019130a6e4e69e53345f403ba802edfb.tar.gz unit-0f3abebd019130a6e4e69e53345f403ba802edfb.tar.bz2 |
Fixing connection remote sockaddr leakage.
Earlier patch 1bf971f83571 fixes connection leakage. But connection
free requires separate remote sockaddr release.
Diffstat (limited to 'src')
-rw-r--r-- | src/nxt_router.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/nxt_router.c b/src/nxt_router.c index b3e326d0..8b3f3daf 100644 --- a/src/nxt_router.c +++ b/src/nxt_router.c @@ -3177,8 +3177,12 @@ nxt_router_listen_event_release(nxt_task_t *task, nxt_listen_event_t *lev, nxt_debug(task, "listen event count: %D", lev->count); + engine = task->thread->engine; + if (--lev->count == 0) { if (lev->next != NULL) { + nxt_sockaddr_cache_free(engine, lev->next); + nxt_conn_free(task, lev->next); } @@ -3189,8 +3193,6 @@ nxt_router_listen_event_release(nxt_task_t *task, nxt_listen_event_t *lev, nxt_router_conf_release(task, joint); } - engine = task->thread->engine; - if (engine->shutdown && nxt_queue_is_empty(&engine->joints)) { nxt_thread_exit(task->thread); } |