[asterisk-bugs] [Asterisk 0013058]: [patch] ast_str api janitor

noreply at bugs.digium.com noreply at bugs.digium.com
Thu Jul 10 16:35:06 CDT 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=13058 
====================================================================== 
Reported By:                pputman
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   13058
Category:                   Applications/app_meetme
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!): 129732 
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             07-10-2008 15:11 CDT
Last Modified:              07-10-2008 16:35 CDT
====================================================================== 
Summary:                    [patch] ast_str api janitor
Description: 
Changes certain strings to ast_str to replace multiple library calls
====================================================================== 

---------------------------------------------------------------------- 
 russell - 07-10-08 16:35  
---------------------------------------------------------------------- 
That is correct.  ast_str_alloca() allocates stack spaces, while
ast_str_create() allocates memory on the heap, and must be explicitly
free'd.

If the string is only used within the context of a single function call,
and is not a _huge_ buffer (8 kB for example), then ast_str_alloca is
preferred as it is more efficient, and has less potential for introducing
problems by accidentally not freeing memory. 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
07-10-08 16:35  russell        Note Added: 0090050                          
======================================================================




More information about the asterisk-bugs mailing list