[asterisk-commits] mmichelson: branch 1.4 r175407 - /branches/1.4/main/file.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Feb 12 17:22:44 CST 2009


Author: mmichelson
Date: Thu Feb 12 17:22:44 2009
New Revision: 175407

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=175407
Log:
Fix a place where filestreams were not refcounted properly

This section was already present in trunk and other branches,
but did not exist in 1.4.

(closes issue #14395)
Reported by: ZX81
Patches:
      14395.patch uploaded by putnopvut (license 60)
Tested by: ZX81


Modified:
    branches/1.4/main/file.c

Modified: branches/1.4/main/file.c
URL: http://svn.digium.com/svn-view/asterisk/branches/1.4/main/file.c?view=diff&rev=175407&r1=175406&r2=175407
==============================================================================
--- branches/1.4/main/file.c (original)
+++ branches/1.4/main/file.c Thu Feb 12 17:22:44 2009
@@ -729,10 +729,19 @@
 			goto return_failure;
 		
 		fr = s->fmt->read(s, &whennext);
+		if (fr) {
+			ast_set_flag(fr, AST_FRFLAG_FROM_FILESTREAM);
+			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) {




More information about the asterisk-commits mailing list