am e1a124e5
: Merge "Say explicitly if there were no leaks."
# Via Elliott Hughes (1) and Gerrit Code Review (1) * commit 'e1a124e5c93b59e2b6792e4de8a2c72dc0a78be1': Say explicitly if there were no leaks.
This commit is contained in:
commit
fb55511e71
1 changed files with 5 additions and 4 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue