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

Asterisk Bug Tracker noreply at bugs.digium.com
Wed Sep 17 14:06:53 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:                     new
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 14:06 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
====================================================================== 

---------------------------------------------------------------------- 
 (0092631) putnopvut (administrator) - 2008-09-17 14:06
 http://bugs.digium.com/view.php?id=13498#c92631 
---------------------------------------------------------------------- 
Wow, not only is it trivial, it looks like this will actually make freeing
a NULL pointer more efficient since we won't have to do any hashtable
lookups for the allocated region. I'm going to attach a patch. Please give
it a try. I'm confident that it will do what is desired, but it never hurts
to test. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2008-09-17 14:06 putnopvut      Note Added: 0092631                          
======================================================================




More information about the asterisk-bugs mailing list