Better check that munmap() always works, otherwise it means we might
have miscalculated an address, and if it fails silently, it will eat
all the memory extremely quickly. Let's add a BUG_ON() on munmap's
return.
if (pad >= sizeof(void *) && *(void **)(area - sizeof(void *)) != area)
ABORT_NOW();
- munmap(area - pad, (size + 4095) & -4096);
+ /* better know immediately if an address calculation was wrong! */
+ BUG_ON(munmap(area - pad, (size + 4095) & -4096) == -1);
}
#endif /* _HAPROXY_POOL_OS_H */