summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_tstr.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
commit1f37d8121a3dfc2f039b859835c4ec22e77f01c9 (patch)
treeb430de5baaf62bcbdaf6708dc54ba08809857f01 /src/nxt_tstr.c
parentb2d19155787e7dd85f0a915bb74d4c9aa2cd91d6 (diff)
downloadunit-1f37d8121a3dfc2f039b859835c4ec22e77f01c9.tar.gz
unit-1f37d8121a3dfc2f039b859835c4ec22e77f01c9.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 '')
-rw-r--r--src/nxt_tstr.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/nxt_tstr.c b/src/nxt_tstr.c
index fd01797c..fda585b8 100644
--- a/src/nxt_tstr.c
+++ b/src/nxt_tstr.c
@@ -194,6 +194,15 @@ nxt_tstr_state_done(nxt_tstr_state_t *state, u_char *error)
}
+void
+nxt_tstr_state_release(nxt_tstr_state_t *state)
+{
+#if (NXT_HAVE_NJS)
+ nxt_js_conf_release(state->jcf);
+#endif
+}
+
+
nxt_bool_t
nxt_tstr_is_const(nxt_tstr_t *tstr)
{
@@ -315,3 +324,12 @@ nxt_tstr_query_handle(nxt_task_t *task, nxt_tstr_query_t *query,
task, query->ctx, query->data);
}
}
+
+
+void
+nxt_tstr_query_release(nxt_tstr_query_t *query)
+{
+#if (NXT_HAVE_NJS)
+ nxt_js_release(&query->cache->js);
+#endif
+}