From 3f403e5e285f350620f7d66329fa890806f7fc7a Mon Sep 17 00:00:00 2001 From: Michael Dawson Date: Wed, 22 Dec 2021 17:58:52 -0500 Subject: [PATCH] node-api: add missing initialization of last error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add missing initiatlization of last error which was reported by coverity. Signed-off-by: Michael Dawson PR-URL: https://github.com/nodejs/node/pull/41290 Reviewed-By: Luigi Pinca Reviewed-By: Tobias Nießen Reviewed-By: James M Snell Reviewed-By: Minwoo Jung --- src/js_native_api_v8.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/js_native_api_v8.h b/src/js_native_api_v8.h index 673e697dd6ba1b..bdf68505a7d7a3 100644 --- a/src/js_native_api_v8.h +++ b/src/js_native_api_v8.h @@ -56,6 +56,7 @@ struct napi_env__ { : isolate(context->GetIsolate()), context_persistent(isolate, context) { CHECK_EQ(isolate, context->GetIsolate()); + napi_clear_last_error(this); } virtual ~napi_env__() { // First we must finalize those references that have `napi_finalizer`