diff options
author | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-06-25 18:54:15 +0000 |
---|---|---|
committer | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-06-25 18:54:15 +0000 |
commit | baf08f7f624b86b8e61a7fc5f1176ee5556fcab7 (patch) | |
tree | 4c68ddbab8c55cf3b4e7cd381b3e5ffc3ad6f32b /main/astmm.c | |
parent | 1add16fb09a32d8932f0c11da03c21154a716c0a (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.0@203232 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/astmm.c')
-rw-r--r-- | main/astmm.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/main/astmm.c b/main/astmm.c index f5191c2e5..d85019910 100644 --- a/main/astmm.c +++ b/main/astmm.c @@ -156,10 +156,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(®lock); for (reg = regions[hash]; reg; reg = reg->next) { if (reg->data == ptr) { |