[Home]

Summary:ASTERISK-13033: [patch] On memory allocation failure return NULL or we will crash.
Reporter:Eliel Sardanons (eliel)Labels:
Date Opened:2008-11-07 05:18:10.000-0600Date Closed:2008-11-18 19:00:08.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Core/AstMM
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) astmm.c.patch
Description:ast_alloc_region needs to give up (return NULL) if the ast_region structure couldn't be allocated or asterisk will crash while trying the next line:

ast_copy_string(reg->file, file, sizeof(reg->file));
Comments:By: Digium Subversion (svnbot) 2008-11-18 19:00:07.000-0600

Repository: asterisk
Revision: 157632

U   trunk/main/astmm.c

------------------------------------------------------------------------
r157632 | mmichelson | 2008-11-18 19:00:07 -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 ASTERISK-13033)
Reported by: eliel
Patches:
     astmm.c.patch uploaded by eliel (license 64)


------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=157632