]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Don't free sildet unless we have one
authorMark Spencer <markster@digium.com>
Tue, 28 Oct 2003 14:07:19 +0000 (14:07 +0000)
committerMark Spencer <markster@digium.com>
Tue, 28 Oct 2003 14:07:19 +0000 (14:07 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1679 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_record.c

index cc0e41ee93a8ab039ccacfca5d163f4155bc17d0..9e72be79dec97ae25b1254d6b92ba78c459f2005 100755 (executable)
@@ -56,7 +56,7 @@ static int record_exec(struct ast_channel *chan, void *data)
        struct localuser *u;
        struct ast_frame *f = NULL;
        
-       struct ast_dsp *sildet;         /* silence detector dsp */
+       struct ast_dsp *sildet = NULL;          /* silence detector dsp */
        int totalsilence = 0;
        int dspsilence = 0;
        int silence = 0;                /* amount of silence to allow */
@@ -222,7 +222,8 @@ static int record_exec(struct ast_channel *chan, void *data)
                res = ast_set_read_format(chan, rfmt);
                if (res)
                        ast_log(LOG_WARNING, "Unable to restore read format on '%s'\n", chan->name);
-               ast_dsp_free(sildet);
+               if (sildet)
+                       ast_dsp_free(sildet);
        }
        return res;
 }