From 47d78f67cba92a1a69fde3a0711dec43dc373e73 Mon Sep 17 00:00:00 2001 From: Brian Wellington Date: Tue, 13 Feb 2001 20:29:27 +0000 Subject: [PATCH] Give more information when isc_mempool_destroy() dies with an assertion failure, in the hope that we'll be able to fix the bug one day. --- lib/isc/mem.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/isc/mem.c b/lib/isc/mem.c index a616420806..5757be0d8f 100644 --- a/lib/isc/mem.c +++ b/lib/isc/mem.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: mem.c,v 1.87 2001/02/13 13:20:37 marka Exp $ */ +/* $Id: mem.c,v 1.88 2001/02/13 20:29:27 bwelling Exp $ */ #include @@ -1368,6 +1368,13 @@ isc_mempool_destroy(isc_mempool_t **mpctxp) { REQUIRE(mpctxp != NULL); mpctx = *mpctxp; REQUIRE(VALID_MEMPOOL(mpctx)); +#if ISC_MEMPOOL_NAMES + if (mpctx->allocated > 0) + UNEXPECTED_ERROR(__FILE__, __LINE__, + "isc_mempool_destroy(): mempool %s leaked " + "memory. Please report this error to " + "bind9-bugs@isc.org", mpctx->name); +#endif REQUIRE(mpctx->allocated == 0); mctx = mpctx->mctx;