summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorMark Michelson <mmichelson@digium.com>2008-11-19 00:59:48 +0000
committerMark Michelson <mmichelson@digium.com>2008-11-19 00:59:48 +0000
commit07a22680ee54082a5a109d0c8b2fda5ea17ca9d8 (patch)
treec749cb78dcda379563bcea85596e2b8c63873189 /main
parent559e644b63ad59df5edb96ff233dba57b9d4ac47 (diff)
If malloc returns NULL, we need to return NULL immediately or
else Asterisk will crash when attempting to dereference the NULL pointer (closes issue #13858) Reported by: eliel Patches: astmm.c.patch uploaded by eliel (license 64) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@157632 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main')
-rw-r--r--main/astmm.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/main/astmm.c b/main/astmm.c
index 4659d5be2..b1d34dd5f 100644
--- a/main/astmm.c
+++ b/main/astmm.c
@@ -114,6 +114,7 @@ static inline void *__ast_alloc_region(size_t size, const enum func_type which,
if (!(reg = malloc(size + sizeof(*reg) + sizeof(*fence)))) {
astmm_log("Memory Allocation Failure - '%d' bytes in function %s "
"at line %d of %s\n", (int) size, func, lineno, file);
+ return NULL;
}
ast_copy_string(reg->file, file, sizeof(reg->file));