From c516c84e5225250daced728a7a37ef5a75b171f4 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 e3e90dbad98cb6..97261256858403 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; }