diff options
author | Mark Spencer <markster@digium.com> | 2003-10-28 14:07:19 +0000 |
---|---|---|
committer | Mark Spencer <markster@digium.com> | 2003-10-28 14:07:19 +0000 |
commit | 71dd98a22eeacdda1b861aafc5a55feb38b49b27 (patch) | |
tree | c458227909efd80f46294babb15bc9480c4f7197 /apps/app_record.c | |
parent | 0de223a1ee6200ce2237e03a4b093e35770ea608 (diff) |
Don't free sildet unless we have one
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1679 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_record.c')
-rwxr-xr-x | apps/app_record.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/apps/app_record.c b/apps/app_record.c index cc0e41ee9..9e72be79d 100755 --- a/apps/app_record.c +++ b/apps/app_record.c @@ -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; } |