From: Dmitry Volyntsev Date: Fri, 30 Oct 2026 03:14:34 +0000 (-0700) Subject: QuickJS: free joined string with chain pool in qjs_string_create_chb() X-Git-Url: https://git.kaiwu.me/?a=commitdiff_plain;h=cb97e2602f7f3b38b2c54d13c25d400dd5fc08bf;p=njs.git QuickJS: free joined string with chain pool in qjs_string_create_chb() Previously, the joined string was freed with the JSContext passed as the pool argument of the chain free function. This only worked for chains initialized with NJS_CHB_CTX_INIT(), where the pool is the context itself. Now, the chain pool is used, so the function works with chains using any allocator. No functional changes for existing callers. --- diff --git a/src/qjs.c b/src/qjs.c index 78d8f3fd..99fdd944 100644 --- a/src/qjs.c +++ b/src/qjs.c @@ -1350,7 +1350,7 @@ qjs_string_create_chb(JSContext *cx, njs_chb_t *chain) val = JS_NewStringLen(cx, (const char *) str.start, str.length); - chain->free(cx, str.start); + chain->free(chain->pool, str.start); return val; }