From f26319b4566f9852e48f6660e14132968de699e6 Mon Sep 17 00:00:00 2001 From: Dmitry Volyntsev Date: Mon, 16 Oct 2023 18:09:37 -0700 Subject: [PATCH] Modules: fixed items() method of a shared dictionary. Previously, under a memory pressure the method might return prematurely while still holding the mutex for the shared memory. This fixes #676 issue on Github. --- nginx/ngx_js_shared_dict.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nginx/ngx_js_shared_dict.c b/nginx/ngx_js_shared_dict.c index c36a585b..14494147 100644 --- a/nginx/ngx_js_shared_dict.c +++ b/nginx/ngx_js_shared_dict.c @@ -819,7 +819,7 @@ njs_js_ext_shared_dict_items(njs_vm_t *vm, njs_value_t *args, njs_uint_t nargs, rc = njs_vm_array_alloc(vm, kv, 2); if (rc != NJS_OK) { - return NJS_ERROR; + goto fail; } value = njs_vm_array_push(vm, kv); -- 2.47.3