aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authormmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2009-06-25 18:55:07 +0000
committermmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2009-06-25 18:55:07 +0000
commit103abda8ea9dd79c9e9c6562563403962b405ac1 (patch)
tree6bafb5c6fd5ad2eb451a576831f5d4315aa2e6f1 /main
parent8c72a0ab0f02f490fe2a48bc9381a5e16d631750 (diff)
Merged revisions 203231 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ................ r203231 | mmichelson | 2009-06-25 13:53:12 -0500 (Thu, 25 Jun 2009) | 8 lines Blocked revisions 203230 via svnmerge ........ r203230 | mmichelson | 2009-06-25 13:52:22 -0500 (Thu, 25 Jun 2009) | 3 lines Prevent false positives when freeing a NULL pointer with MALLOC_DEBUG enabled. ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.1@203233 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r--main/astmm.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/main/astmm.c b/main/astmm.c
index e72c1e318..bbcc6b54e 100644
--- a/main/astmm.c
+++ b/main/astmm.c
@@ -157,10 +157,16 @@ static inline size_t __ast_sizeof_region(void *ptr)
static void __ast_free_region(void *ptr, const char *file, int lineno, const char *func)
{
- int hash = HASH(ptr);
+ int hash;
struct ast_region *reg, *prev = NULL;
unsigned int *fence;
+ if (!ptr) {
+ return;
+ }
+
+ hash = HASH(ptr);
+
ast_mutex_lock(&reglock);
for (reg = regions[hash]; reg; reg = reg->next) {
if (reg->data == ptr) {