Skip to content

Commit

Permalink
napi: supress invalid coverity leak message
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
mhdawson authored and MylesBorins committed Apr 16, 2018
1 parent f1bdbd1 commit 9b36811
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/node_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2291,6 +2291,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,
Expand Down

0 comments on commit 9b36811

Please sign in to comment.