Skip to content

Commit 76cf2cf

Browse files
committed
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.
1 parent 9b05393 commit 76cf2cf

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/node_api.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2274,6 +2274,10 @@ napi_status napi_create_external_buffer(napi_env env,
22742274

22752275
*result = v8impl::JsValueFromV8LocalValue(maybe.ToLocalChecked());
22762276
return GET_RETURN_STATUS();
2277+
// Tell coverity that 'finalizer' should not be freed when we return
2278+
// as it will be deleted when the buffer to which it is associated
2279+
// is finalized.
2280+
// coverity[leaked_storage]
22772281
}
22782282

22792283
napi_status napi_create_buffer_copy(napi_env env,

0 commit comments

Comments
 (0)