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 6, 2022
1 parent 00f693b commit c6a558c
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 c6a558c

Please sign in to comment.