Skip to content

Commit

Permalink
src: suppress false coverity warning
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Dawson <mdawson@devrus.com>

PR-URL: #42284
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
mhdawson authored and juanarbol committed Apr 4, 2022
1 parent 89da27c commit c516c84
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/api/environment.cc
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,12 @@ void* DebuggingArrayBufferAllocator::Reallocate(void* data,
Mutex::ScopedLock lock(mutex_);
void* ret = NodeArrayBufferAllocator::Reallocate(data, old_size, size);
if (ret == nullptr) {
if (size == 0) // i.e. equivalent to free().
if (size == 0) { // i.e. equivalent to free().
// suppress coverity warning as data is used as key versus as pointer
// in UnregisterPointerInternal
// coverity[pass_freed_arg]
UnregisterPointerInternal(data, old_size);
}
return nullptr;
}

Expand Down

0 comments on commit c516c84

Please sign in to comment.