MINOR: debug: don't count free(NULL) in memstats
authorWilly Tarreau <w@1wt.eu>
Tue, 3 Nov 2020 14:59:23 +0000 (15:59 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 3 Nov 2020 15:46:48 +0000 (16:46 +0100)
commit9dd7f4fb4bf84450f0eb01b6e2d206f8481727fb
treeb1292525fe1e8f0e909b96f793ee7e380000e50d
parent04a5a440b8d7504c8c02105a981be89cf3f7f853
MINOR: debug: don't count free(NULL) in memstats

The mem stats are pretty convenient to spot leaks, except that they count
free(NULL) as 1, and the code does actually have quite a number of free(foo)
guards where foo is NULL if the object was already freed. Let's just not
count these ones so that the stats remain consistent. Now it's possible
to compare the strdup()/malloc() and free() and verify they are consistent.
include/haproxy/bug.h