summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_router.c
diff options
context:
space:
mode:
authorZhidao HONG <z.hong@f5.com>2023-01-30 11:16:01 +0800
committerZhidao HONG <z.hong@f5.com>2023-01-30 11:16:01 +0800
commit789762ff3d88a1c006babc7a8e7037e0976ad70f (patch)
tree4988386a1644bbbe9f8f3c98c29430fdd71f74d9 /src/nxt_router.c
parentcbc01907fef6a028f02d9051b909def920c49f24 (diff)
downloadunit-789762ff3d88a1c006babc7a8e7037e0976ad70f.tar.gz
unit-789762ff3d88a1c006babc7a8e7037e0976ad70f.tar.bz2
NJS: adding the missing vm destruction.
This commit fixed the njs memory leak happened in the config validation, updating and http requests.
Diffstat (limited to 'src/nxt_router.c')
-rw-r--r--src/nxt_router.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/nxt_router.c b/src/nxt_router.c
index edc015c5..17f6c572 100644
--- a/src/nxt_router.c
+++ b/src/nxt_router.c
@@ -1111,6 +1111,10 @@ temp_fail:
fail:
+ if (rtcf->tstr_state != NULL) {
+ nxt_tstr_state_release(rtcf->tstr_state);
+ }
+
nxt_mp_destroy(mp);
return NULL;
@@ -3794,6 +3798,8 @@ nxt_router_conf_release(nxt_task_t *task, nxt_socket_conf_joint_t *joint)
nxt_router_access_log_release(task, lock, rtcf->access_log);
+ nxt_tstr_state_release(rtcf->tstr_state);
+
nxt_mp_thread_adopt(rtcf->mem_pool);
nxt_mp_destroy(rtcf->mem_pool);