Skip to content
Snippets Groups Projects
Commit 07a22680 authored by Mark Michelson's avatar Mark Michelson
Browse files

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
parent 559e644b
No related branches found
No related tags found
No related merge requests found
......@@ -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));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment