From 27726cb6aad8e4cb48ceae80d36a5ebaf61e6daa Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Sat, 12 Sep 2009 14:48:33 +0200 Subject: hush: make memleak debugging more robust Signed-off-by: Denys Vlasenko --- shell/hush.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/shell/hush.c b/shell/hush.c index a02a4874f..63b95633d 100644 --- a/shell/hush.c +++ b/shell/hush.c @@ -78,6 +78,7 @@ * Licensed under the GPL v2 or later, see the file LICENSE in this tarball. */ #include "busybox.h" /* for APPLET_IS_NOFORK/NOEXEC */ +#include /* for malloc_trim */ #include /* #include */ #if ENABLE_HUSH_CASE @@ -7265,6 +7266,10 @@ static int FAST_FUNC builtin_memleak(char **argv UNUSED_PARAM) void *p; unsigned long l; +#ifdef M_TRIM_THRESHOLD + /* Optional. Reduces probability of false positives */ + malloc_trim(0); +#endif /* Crude attempt to find where "free memory" starts, * sans fragmentation. */ p = malloc(240); -- cgit v1.2.3