aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2009-03-18 07:44:52 -0400
committerMike Frysinger <vapier@gentoo.org>2009-03-18 23:36:08 -0400
commit2641abe6d67ecaa89a1ed7bd6dad93cf63bdd6c0 (patch)
tree3177d5c052bdee022ca6920be595c18fbbf55b97 /libsandbox/memory.c
parentsandbox: add desktop/icon files (diff)
downloadsandbox-2641abe6d67ecaa89a1ed7bd6dad93cf63bdd6c0.tar.gz
sandbox-2641abe6d67ecaa89a1ed7bd6dad93cf63bdd6c0.tar.bz2
sandbox-2641abe6d67ecaa89a1ed7bd6dad93cf63bdd6c0.zip
libsandbox: initial support for tracing of static binaries via ptrace()
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'libsandbox/memory.c')
-rw-r--r--libsandbox/memory.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libsandbox/memory.c b/libsandbox/memory.c
index 180e250..05e9691 100644
--- a/libsandbox/memory.c
+++ b/libsandbox/memory.c
@@ -63,6 +63,9 @@ void *realloc(void *ptr, size_t size)
}
old_malloc_size = SB_MALLOC_TO_SIZE(ptr);
+ /* Since mmap() is heavy, don't bother shrinking */
+ if (size <= old_malloc_size)
+ return ptr;
ret = malloc(size);
if (!ret)
return ret;