summaryrefslogtreecommitdiffstats
path: root/libc/bionic
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2013-01-30 12:27:12 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2013-01-30 12:27:12 -0800
commit8db7a4cb20a7e90feb981736c1618f91a27bfff8 (patch)
tree0d8187d0bfcbcc29db50726b99e020fcaab0058e /libc/bionic
parent0243962d2089dc57e2488b23e6d33e2a012e2aa5 (diff)
parent9743d7fb60836229fde0fbdbd9fb87c78eaa00b7 (diff)
downloadbionic-8db7a4cb20a7e90feb981736c1618f91a27bfff8.zip
bionic-8db7a4cb20a7e90feb981736c1618f91a27bfff8.tar.gz
bionic-8db7a4cb20a7e90feb981736c1618f91a27bfff8.tar.bz2
am 9743d7fb: am fb55511e: am e1a124e5: Merge "Say explicitly if there were no leaks."
# Via Android Git Automerger (2) and others * commit '9743d7fb60836229fde0fbdbd9fb87c78eaa00b7': Say explicitly if there were no leaks.
Diffstat (limited to 'libc/bionic')
-rw-r--r--libc/bionic/malloc_debug_check.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/libc/bionic/malloc_debug_check.cpp b/libc/bionic/malloc_debug_check.cpp
index 18c3ed4..394b8bb 100644
--- a/libc/bionic/malloc_debug_check.cpp
+++ b/libc/bionic/malloc_debug_check.cpp
@@ -437,10 +437,6 @@ extern "C" void *chk_calloc(int nmemb, size_t size) {
}
static void heaptracker_free_leaked_memory() {
- if (gAllocatedBlockCount == 0) {
- return;
- }
-
// Use /proc/self/exe link to obtain the program name for logging
// purposes. If it's not available, we set it to "<unknown>".
char exe[PATH_MAX];
@@ -451,6 +447,11 @@ static void heaptracker_free_leaked_memory() {
exe[count] = '\0';
}
+ if (gAllocatedBlockCount == 0) {
+ log_message("+++ %s did not leak", exe);
+ return;
+ }
+
size_t index = 1;
const size_t total = gAllocatedBlockCount;
while (head != NULL) {