Previously, when the resolver context allocation failed, both engines
returned without deleting the registered fetch event and reported the
error with a synchronous throw instead of rejecting the returned
promise, unlike all other failure paths.
if (ctx == NULL) {
njs_vm_memory_error(vm);
- return NJS_ERROR;
+ goto fail;
}
if (ctx == NGX_NO_RESOLVER) {
ngx_qjs_external_resolver_timeout(cx, external));
if (rs == NULL) {
- JS_FreeValue(cx, promise);
- return JS_ThrowOutOfMemory(cx);
+ JS_ThrowOutOfMemory(cx);
+ goto fail;
}
if (rs == NGX_NO_RESOLVER) {