From c8937f812cc4f87a7d1661dca37e872b750d83c7 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 --- 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; }