summaryrefslogtreecommitdiff
path: root/main/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'main/file.c')
-rw-r--r--main/file.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/main/file.c b/main/file.c
index 995ba4a0c..d4aeea720 100644
--- a/main/file.c
+++ b/main/file.c
@@ -719,9 +719,14 @@ static enum fsread_res ast_readaudio_callback(struct ast_filestream *s)
ao2_ref(s, +1);
}
if (!fr /* stream complete */ || ast_write(s->owner, fr) /* error writing */) {
- if (fr)
+ if (fr) {
ast_log(LOG_WARNING, "Failed to write frame\n");
+ ast_frfree(fr);
+ }
goto return_failure;
+ }
+ if (fr) {
+ ast_frfree(fr);
}
}
if (whennext != s->lasttimeout) {