Skip to content

Commit 491d59d

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. PR-URL: #12192 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Hitesh Kanwathirtha <[email protected]>
1 parent 4a21e39 commit 491d59d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/node_api.cc

+4
Original file line numberDiff line numberDiff line change
@@ -2290,6 +2290,10 @@ napi_status napi_create_external_buffer(napi_env env,
22902290

22912291
*result = v8impl::JsValueFromV8LocalValue(maybe.ToLocalChecked());
22922292
return GET_RETURN_STATUS();
2293+
// Tell coverity that 'finalizer' should not be freed when we return
2294+
// as it will be deleted when the buffer to which it is associated
2295+
// is finalized.
2296+
// coverity[leaked_storage]
22932297
}
22942298

22952299
napi_status napi_create_buffer_copy(napi_env env,

0 commit comments

Comments
 (0)