merge from open-source master
[android-sdk/platform-bionic.git] / libc / bionic / malloc_debug_leak.c
index 2ff8cee9ee0cf904582381032c8c76329d079631..0a3a68daf2b5d400871f94fbb2f687a0b4407e33 100644 (file)
@@ -149,6 +149,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;