From 58d9f6ed9dc054f4046be660353f1fb627145911 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 6 Aug 2007 03:01:59 +0000 Subject: r24246: Avoid the annoying 'probable memory leak in ldb' messages, by fixing some issues in the NBT server (this was a false positive, but easily worked around) and DRSUAPI server. We should take care not to use the ldb_context as a talloc pool, and to always ensure that any results from ldb_search() are moved off that pool with talloc_steal or talloc_free(). To work around the issue in provision, for which I can find no fault (other than a lot of work being done in provision), I've moved the detector trigger to 400 additional blocks. This fixes Bug #4810 by Andrew Bartlett (This used to be commit 42bcf856203ae3cf43130519904828a143ac8d18) --- source4/lib/db_wrap.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source4/lib') diff --git a/source4/lib/db_wrap.c b/source4/lib/db_wrap.c index 89ee0b16d2..0e026f84e1 100644 --- a/source4/lib/db_wrap.c +++ b/source4/lib/db_wrap.c @@ -80,7 +80,7 @@ static int ldb_wrap_destructor(struct ldb_context *ldb) { size_t *startup_blocks = (size_t *)ldb_get_opaque(ldb, "startup_blocks"); if (startup_blocks && - talloc_total_blocks(ldb) > *startup_blocks + 100) { + talloc_total_blocks(ldb) > *startup_blocks + 400) { DEBUG(0,("WARNING: probable memory leak in ldb %s - %lu blocks (startup %lu) %lu bytes\n", (char *)ldb_get_opaque(ldb, "wrap_url"), (unsigned long)talloc_total_blocks(ldb), @@ -88,6 +88,8 @@ static int ldb_wrap_destructor(struct ldb_context *ldb) (unsigned long)talloc_total_size(ldb))); #if 0 talloc_report_full(ldb, stdout); + call_backtrace(); + smb_panic("probable memory leak in ldb"); #endif } return 0; -- cgit