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

Asterisk Bug Tracker noreply at bugs.digium.com
Wed Sep 17 09:34:12 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 09:34 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
====================================================================== 

---------------------------------------------------------------------- 
 (0092621) putnopvut (administrator) - 2008-09-17 09:34
 http://bugs.digium.com/view.php?id=13498#c92621 
---------------------------------------------------------------------- 
I agree that this is mostly a cosmetic thing. Freeing a NULL pointer has no
ill effects, but the memory-manager used when compiling with MALLOC_DEBUG
raises a warning because that block is not one of its allocated regions.
Perhaps astmm.c should be modified so that that warning is supressed if the
equivalent of free(NULL) is issued. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2008-09-17 09:34 putnopvut      Note Added: 0092621                          
======================================================================




More information about the asterisk-bugs mailing list