diff options
author | André Goddard Rosa <andre.goddard@gmail.com> | 2010-02-05 16:03:09 -0200 |
---|---|---|
committer | Jean-Baptiste Queru <jbq@google.com> | 2010-04-29 07:37:42 -0700 |
commit | 5751c54bf1c84ad9b1e23a6909c59431c973deae (patch) | |
tree | 32d6c36cfb0bdbabfc6051344ad1cb23f450eaeb /libc | |
parent | c8a850bcd174acf43f951b5b70783cb636418b53 (diff) | |
download | bionic-5751c54bf1c84ad9b1e23a6909c59431c973deae.zip bionic-5751c54bf1c84ad9b1e23a6909c59431c973deae.tar.gz bionic-5751c54bf1c84ad9b1e23a6909c59431c973deae.tar.bz2 |
bionic: add missing NULL check from memory allocation on record_backtrace()
Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com>
Change-Id: I739c63c5a7344fff1775580044dc647edf246ebf
Diffstat (limited to 'libc')
-rw-r--r-- | libc/bionic/malloc_leak.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libc/bionic/malloc_leak.c b/libc/bionic/malloc_leak.c index 9796382..b21bc6a 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; |