[asterisk-bugs] [Asterisk 0013498]: freeing unused memory in ast_get_enum

Asterisk Bug Tracker noreply at bugs.digium.com
Wed Sep 17 15:15:56 CDT 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=13498 
====================================================================== 
Reported By:                pj
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   13498
Category:                   Functions/func_enum
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     ready for testing
Asterisk Version:           SVN 
SVN Branch (only for SVN checkouts, not tarball releases):  trunk 
SVN Revision (number only!): 143034 
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             2008-09-16 16:35 CDT
Last Modified:              2008-09-17 15:15 CDT
====================================================================== 
Summary:                    freeing unused memory in ast_get_enum
Description: 
I found some incorrect memory handling in enum.c,
every time asterisk invoke ENUMLOOKUP() function, 
it generates following warnings in mmlog:
WARNING: Freeing unused memory at (nil), in ast_get_enum of enum.c, line
897
WARNING: Freeing unused memory at (nil), in ast_get_enum of enum.c, line
897
WARNING: Freeing unused memory at (nil), in ast_get_enum of enum.c, line
897
WARNING: Freeing unused memory at (nil), in ast_get_enum of enum.c, line
897
WARNING: Freeing unused memory at (nil), in ast_get_enum of enum.c, line
897
====================================================================== 

---------------------------------------------------------------------- 
 (0092636) svnbot (reporter) - 2008-09-17 15:15
 http://bugs.digium.com/view.php?id=13498#c92636 
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 143400

U   trunk/main/astmm.c

------------------------------------------------------------------------
r143400 | mmichelson | 2008-09-17 15:15:55 -0500 (Wed, 17 Sep 2008) | 16
lines

If attempting to free a NULL pointer when MALLOC_DEBUG
is set, don't bother searching for a region to free, just
immediately exit.

This has the dual benefit of suppressing a warning message
about freeing memory at (nil) and of optimizing the free()
replacement by not having to do any futile searching for
the proper region to free.

(closes issue http://bugs.digium.com/view.php?id=13498)
Reported by: pj
Patches:
      13498.patch uploaded by putnopvut (license 60)
Tested by: pj


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

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

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2008-09-17 15:15 svnbot         Note Added: 0092636                          
======================================================================




More information about the asterisk-bugs mailing list