diff --git a/include/haproxy/bug.h b/include/haproxy/bug.h index ad2018b13..f5ed7f419 100644 --- a/include/haproxy/bug.h +++ b/include/haproxy/bug.h @@ -124,7 +124,8 @@ struct mem_stats { }; \ __asm__(".globl __start_mem_stats"); \ __asm__(".globl __stop_mem_stats"); \ - _HA_ATOMIC_ADD(&_.calls, 1); \ + if (__x) \ + _HA_ATOMIC_ADD(&_.calls, 1); \ free(__x); \ })