From dc3f7671450abad27554642a492ab2bc87496aff Mon Sep 17 00:00:00 2001 From: Michael Dawson Date: Thu, 10 Mar 2022 09:50:04 -0500 Subject: [PATCH] src: suppress false coverity warning Signed-off-by: Michael Dawson PR-URL: https://github.com/nodejs/node/pull/42284 Reviewed-By: Darshan Sen Reviewed-By: Anna Henningsen Reviewed-By: James M Snell --- src/api/environment.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/api/environment.cc b/src/api/environment.cc index 55b895c235f51e..cc3edb87feb6ba 100644 --- a/src/api/environment.cc +++ b/src/api/environment.cc @@ -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; }