Don't free anything when reporting leaks.
We don't know that they're not going to be cleaned up by a
C++ global destructor that runs after us. This is the case with
bootanimation, for example.
Bug: 7291287
Change-Id: Iba402514d1735fdc2ae4bc95b65396d816be46c0
diff --git a/libc/bionic/malloc_debug_check.cpp b/libc/bionic/malloc_debug_check.cpp
index 60ee0cc..7b6a536 100644
--- a/libc/bionic/malloc_debug_check.cpp
+++ b/libc/bionic/malloc_debug_check.cpp
@@ -362,8 +362,6 @@
log_message("+++ ALLOCATION %p IS CORRUPTED OR NOT ALLOCATED VIA TRACKER!\n",
user(hdr));
log_backtrace(gMapInfo, bt, depth);
- /* Leak here so that we do not crash */
- //dlfree(user(hdr));
}
} else {
hdr->freed_bt_depth = get_backtrace(hdr->freed_bt,
@@ -459,14 +457,12 @@
/* safe == 1, because the allocation is valid */
log_backtrace(gMapInfo, del->bt, del->bt_depth);
}
- dlfree(del);
}
// log_message("+++ DELETING %d BACKLOGGED ALLOCATIONS\n", backlog_num);
while (backlog_head) {
del = backlog_tail;
del_from_backlog(del);
- dlfree(del);
}
}