From cb97e2602f7f3b38b2c54d13c25d400dd5fc08bf Mon Sep 17 00:00:00 2001 From: Dmitry Volyntsev Date: Thu, 29 Oct 2026 20:14:34 -0700 Subject: [PATCH] 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. --- src/qjs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- 2.47.3