diff options
author | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-11-19 01:00:44 +0000 |
---|---|---|
committer | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-11-19 01:00:44 +0000 |
commit | bd20ac4cd49de93892e9fe37fb958b9128d3457c (patch) | |
tree | 87130118c9455a673ff10afb3e5d62bf03ef5dce /main/astmm.c | |
parent | a71d87991e8816f88cde60bd988ada6fbb0c1c9f (diff) |
Merged revisions 157632 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
........
r157632 | mmichelson | 2008-11-18 18:59:48 -0600 (Tue, 18 Nov 2008) | 10 lines
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: http://svn.digium.com/svn/asterisk/branches/1.6.1@157636 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/astmm.c')
-rw-r--r-- | main/astmm.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/main/astmm.c b/main/astmm.c index f5191c2e5..e72c1e318 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)); |