Skip to content

Commit 9b36811

Browse files
mhdawsonMylesBorins
authored andcommitted
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. Backport-PR-URL: #19447 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 f1bdbd1 commit 9b36811

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/node_api.cc

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

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

22962300
napi_status napi_create_buffer_copy(napi_env env,

0 commit comments

Comments
 (0)