From 5751c54bf1c84ad9b1e23a6909c59431c973deae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Goddard=20Rosa?= Date: Fri, 5 Feb 2010 16:03:09 -0200 Subject: [PATCH] bionic: add missing NULL check from memory allocation on record_backtrace() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: André Goddard Rosa Change-Id: I739c63c5a7344fff1775580044dc647edf246ebf --- libc/bionic/malloc_leak.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libc/bionic/malloc_leak.c b/libc/bionic/malloc_leak.c index 9796382b2..b21bc6acf 100644 --- a/libc/bionic/malloc_leak.c +++ b/libc/bionic/malloc_leak.c @@ -323,6 +323,8 @@ static HashEntry* record_backtrace(intptr_t* backtrace, size_t numEntries, size_ } else { // create a new entry entry = (HashEntry*)dlmalloc(sizeof(HashEntry) + numEntries*sizeof(intptr_t)); + if (!entry) + return NULL; entry->allocations = 1; entry->slot = slot; entry->prev = NULL;