aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authormmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2009-04-15 20:20:46 +0000
committermmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2009-04-15 20:20:46 +0000
commita685cbacf4d4d449ce01e3784a9948fbb9d73c71 (patch)
tree63d98a15b9b4c3c7db7dc9e2e471173c61b24fa3 /main
parent4201f622e907b454838980d02319ed1d9121020f (diff)
Merged revisions 188585 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ................ r188585 | mmichelson | 2009-04-15 15:17:33 -0500 (Wed, 15 Apr 2009) | 13 lines Merged revisions 188582 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r188582 | mmichelson | 2009-04-15 15:04:20 -0500 (Wed, 15 Apr 2009) | 7 lines Update ast_readvideo_callback to match ast_readaudio_callback. This fixes potential refcount errors that may occur on ast_filestreams. AST-208 ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.2@188598 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r--main/file.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/main/file.c b/main/file.c
index ac47b2b51..0439d03a8 100644
--- a/main/file.c
+++ b/main/file.c
@@ -778,12 +778,17 @@ static enum fsread_res ast_readvideo_callback(struct ast_filestream *s)
ast_set_flag(fr, AST_FRFLAG_FROM_FILESTREAM);
ao2_ref(s, +1);
}
- if (!fr || ast_write(s->owner, fr)) { /* no stream or error, as above */
- if (fr)
+ if (!fr /* stream complete */ || ast_write(s->owner, fr) /* error writing */) {
+ if (fr) {
ast_log(LOG_WARNING, "Failed to write frame\n");
+ ast_frfree(fr);
+ }
s->owner->vstreamid = -1;
return FSREAD_FAILURE;
}
+ if (fr) {
+ ast_frfree(fr);
+ }
}
if (whennext != s->lasttimeout) {