From: Francesco Chemolli Date: Wed, 30 Sep 2015 14:12:55 +0000 (+0200) Subject: Align behavior of MEMPROXY_CLASS's operator delete with ::delete on nullptr X-Git-Tag: SQUID_4_0_1~24 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6ba24a7c5246e38b4a03da1024e6e6b2fe5aa555;p=thirdparty%2Fsquid.git Align behavior of MEMPROXY_CLASS's operator delete with ::delete on nullptr --- diff --git a/src/mem/AllocatorProxy.h b/src/mem/AllocatorProxy.h index d4303cb214..18faf69434 100644 --- a/src/mem/AllocatorProxy.h +++ b/src/mem/AllocatorProxy.h @@ -35,7 +35,10 @@ class MemPoolMeter; assert(byteCount == sizeof(CLASS)); \ return Pool().alloc(); \ } \ - void operator delete(void *address) {Pool().freeOne(address);} \ + void operator delete(void *address) { \ + if (address) \ + Pool().freeOne(address); \ + } \ private: namespace Mem