From: Jason Parker Date: Fri, 7 Dec 2007 23:29:01 +0000 (+0000) Subject: We need to make sure we free the input frame if we return a different frame in ast_ds... X-Git-Tag: 1.4.16~39 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=16a03298e9ba8dedd0c7b82eeefb7a7ea8919655;p=thirdparty%2Fasterisk.git 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. git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@91890 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/dsp.c b/main/dsp.c index f72759d072..4ec1a82656 100644 --- a/main/dsp.c +++ b/main/dsp.c @@ -1485,6 +1485,7 @@ struct ast_frame *ast_dsp_process(struct ast_channel *chan, struct ast_dsp *dsp, if ((dsp->features & DSP_FEATURE_SILENCE_SUPPRESS) && silence) { memset(&dsp->f, 0, sizeof(dsp->f)); dsp->f.frametype = AST_FRAME_NULL; + ast_frfree(af); return &dsp->f; } if ((dsp->features & DSP_FEATURE_BUSY_DETECT) && ast_dsp_busydetect(dsp)) { @@ -1492,6 +1493,7 @@ struct ast_frame *ast_dsp_process(struct ast_channel *chan, struct ast_dsp *dsp, memset(&dsp->f, 0, sizeof(dsp->f)); dsp->f.frametype = AST_FRAME_CONTROL; dsp->f.subclass = AST_CONTROL_BUSY; + ast_frfree(af); ast_log(LOG_DEBUG, "Requesting Hangup because the busy tone was detected on channel %s\n", chan->name); return &dsp->f; }