From 76cf2cf194aadb4208400f8362355215068bfbe1 Mon Sep 17 00:00:00 2001 From: Michael Dawson Date: Mon, 3 Apr 2017 12:34:34 -0400 Subject: [PATCH] napi: supress invalid coverity leak message Coverity was complaining that finalizer was being leaked in this method, however it should be freed when the buffer is finalized so I believe the message is invalid. Add the required comments to suppress the warning. --- src/node_api.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/node_api.cc b/src/node_api.cc index a94ee6af4fd2a9..904e59704cd737 100644 --- a/src/node_api.cc +++ b/src/node_api.cc @@ -2274,6 +2274,10 @@ napi_status napi_create_external_buffer(napi_env env, *result = v8impl::JsValueFromV8LocalValue(maybe.ToLocalChecked()); return GET_RETURN_STATUS(); + // Tell coverity that 'finalizer' should not be freed when we return + // as it will be deleted when the buffer to which it is associated + // is finalized. + // coverity[leaked_storage] } napi_status napi_create_buffer_copy(napi_env env,