From: Dmitry Volyntsev Date: Tue, 17 Oct 2023 01:09:37 +0000 (-0700) Subject: Modules: fixed items() method of a shared dictionary. X-Git-Tag: 0.8.2~5 X-Git-Url: http://www.kaiwu.me/postgresql/commit/?a=commitdiff_plain;h=f26319b4566f9852e48f6660e14132968de699e6;p=njs.git 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. --- 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);