Skip to content

Commit 9b36811

Browse files
mhdawsonMylesBorins
authored andcommittedApr 16, 2018
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 <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Hitesh Kanwathirtha <hiteshk@microsoft.com>
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

+4
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)