Increase leak detective backtrace depth by a frame
authorMartin Willi <martin@revosec.ch>
Thu, 12 Jul 2012 07:27:20 +0000 (09:27 +0200)
committerMartin Willi <martin@revosec.ch>
Fri, 13 Jul 2012 11:23:29 +0000 (13:23 +0200)
src/libstrongswan/utils/leak_detective.c

index 9f2a9e4..ed0899d 100644 (file)
@@ -474,7 +474,7 @@ void *malloc_hook(size_t bytes, const void *caller)
 
        hdr->magic = MEMORY_HEADER_MAGIC;
        hdr->bytes = bytes;
-       hdr->backtrace = backtrace_create(3);
+       hdr->backtrace = backtrace_create(2);
        tail->magic = MEMORY_TAIL_MAGIC;
        install_hooks();
 
@@ -543,7 +543,7 @@ void free_hook(void *ptr, const void *caller)
                        /* memory was not allocated by our hooks */
                        fprintf(stderr, "freeing invalid memory (%p)", ptr);
                }
-               backtrace = backtrace_create(3);
+               backtrace = backtrace_create(2);
                backtrace->log(backtrace, stderr, TRUE);
                backtrace->destroy(backtrace);
        }
@@ -601,7 +601,7 @@ void *realloc_hook(void *old, size_t bytes, const void *caller)
        {
                fprintf(stderr, "reallocating invalid memory (%p):\n"
                                "header magic 0x%x:\n", old, hdr->magic);
-               backtrace = backtrace_create(3);
+               backtrace = backtrace_create(2);
                backtrace->log(backtrace, stderr, TRUE);
                backtrace->destroy(backtrace);
        }
@@ -617,7 +617,7 @@ void *realloc_hook(void *old, size_t bytes, const void *caller)
        /* update statistics */
        hdr->bytes = bytes;
        hdr->backtrace->destroy(hdr->backtrace);
-       hdr->backtrace = backtrace_create(3);
+       hdr->backtrace = backtrace_create(2);
 
        /* update header of linked list neighbours */
        if (hdr->next)