aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2009-09-12 14:48:33 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2009-09-12 14:48:33 +0200
commit27726cb6aad8e4cb48ceae80d36a5ebaf61e6daa (patch)
tree79c3a4f1889af6e0b1076833aec628a559e6d865
parent873273da94734fda1902b385d7f3e39daf675e35 (diff)
downloadbusybox-w32-27726cb6aad8e4cb48ceae80d36a5ebaf61e6daa.tar.gz
busybox-w32-27726cb6aad8e4cb48ceae80d36a5ebaf61e6daa.tar.bz2
busybox-w32-27726cb6aad8e4cb48ceae80d36a5ebaf61e6daa.zip
hush: make memleak debugging more robust
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--shell/hush.c5
1 files changed, 5 insertions, 0 deletions
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 @@
78 * Licensed under the GPL v2 or later, see the file LICENSE in this tarball. 78 * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
79 */ 79 */
80#include "busybox.h" /* for APPLET_IS_NOFORK/NOEXEC */ 80#include "busybox.h" /* for APPLET_IS_NOFORK/NOEXEC */
81#include <malloc.h> /* for malloc_trim */
81#include <glob.h> 82#include <glob.h>
82/* #include <dmalloc.h> */ 83/* #include <dmalloc.h> */
83#if ENABLE_HUSH_CASE 84#if ENABLE_HUSH_CASE
@@ -7265,6 +7266,10 @@ static int FAST_FUNC builtin_memleak(char **argv UNUSED_PARAM)
7265 void *p; 7266 void *p;
7266 unsigned long l; 7267 unsigned long l;
7267 7268
7269#ifdef M_TRIM_THRESHOLD
7270 /* Optional. Reduces probability of false positives */
7271 malloc_trim(0);
7272#endif
7268 /* Crude attempt to find where "free memory" starts, 7273 /* Crude attempt to find where "free memory" starts,
7269 * sans fragmentation. */ 7274 * sans fragmentation. */
7270 p = malloc(240); 7275 p = malloc(240);