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

noreply at bugs.digium.com noreply at bugs.digium.com
Fri Dec 7 17:29:19 CST 2007


The following issue has been ASSIGNED. 
====================================================================== 
http://bugs.digium.com/view.php?id=11273 
====================================================================== 
Reported By:                dimas
Assigned To:                qwell
====================================================================== 
Project:                    Asterisk
Issue ID:                   11273
Category:                   Core-General
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     assigned
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:              12-07-2007 17:29 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.
====================================================================== 

---------------------------------------------------------------------- 
 svnbot - 12-07-07 17:29  
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 91891

_U  trunk/
U   trunk/main/dsp.c

------------------------------------------------------------------------
r91891 | qwell | 2007-12-07 17:29:17 -0600 (Fri, 07 Dec 2007) | 13 lines

Merged revisions 91890 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

(closes issue http://bugs.digium.com/view.php?id=11273)
........
r91890 | qwell | 2007-12-07 17:29:01 -0600 (Fri, 07 Dec 2007) | 4 lines

We need to make sure we free the input frame if we return a different
frame in ast_dsp_process.

Issue 11273, pointed out by dimas, with a patch by eliel.

........

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

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

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
12-07-07 17:29  svnbot         Checkin                                      
12-07-07 17:29  svnbot         Note Added: 0075077                          
12-07-07 17:29  svnbot         Status                   new => assigned     
12-07-07 17:29  svnbot         Assigned To               => qwell           
======================================================================




More information about the asterisk-bugs mailing list