[asterisk-bugs] [Asterisk 0011273]: possible memory leak in asp_dsp_process

noreply at bugs.digium.com noreply at bugs.digium.com
Fri Nov 16 12:07:47 CST 2007


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=11273 
====================================================================== 
Reported By:                dimas
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   11273
Category:                   Core-General
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!): 89114 
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             11-16-2007 10:13 CST
Last Modified:              11-16-2007 12:07 CST
====================================================================== 
Summary:                    possible memory leak in asp_dsp_process
Description: 
While adding fax tone detection to ReceiveFAX application I discovered one
strange thing in dsp.c. It looks like ast_dsp_process function is supposed
to free the frame it received as input (except for the case when it returns
that frame back).
However it looks like it does not always free the input frame. Namely,
there are two checks:

        if ((dsp->features & DSP_FEATURE_SILENCE_SUPPRESS) && silence) {
and
        if ((dsp->features & DSP_FEATURE_BUSY_DETECT) &&
ast_dsp_busydetect(dsp)) {

which do not do ast_frfree(af) although they return another frame.

To me it looks like a bug but it can be a feature :) so it worth someone
with knowledge to take a look. The fix is straightforward so I'm not
supplying the patch.
====================================================================== 

---------------------------------------------------------------------- 
 eliel - 11-16-07 12:07  
---------------------------------------------------------------------- 
I review the code and you are right, it should be freed.
Patch uploaded, I also check some weird conditions on some channels that
doesn't check the return value of this function, and they don't "know" or
doit wrong when the return value = NULL, that is a impossible condition (I
think (??)). 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
11-16-07 12:07  eliel          Note Added: 0073819                          
======================================================================




More information about the asterisk-bugs mailing list