[asterisk-commits] tilghman: branch 1.4 r60661 - in /branches/1.4: ./ main/file.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Sat Apr 7 18:40:48 MST 2007


Author: tilghman
Date: Sat Apr  7 20:40:47 2007
New Revision: 60661

URL: http://svn.digium.com/view/asterisk?view=rev&rev=60661
Log:
Merged revisions 60660 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r60660 | tilghman | 2007-04-07 20:39:25 -0500 (Sat, 07 Apr 2007) | 2 lines

Bug 9486 - memory leak when opening a filestream

........

Modified:
    branches/1.4/   (props changed)
    branches/1.4/main/file.c

Propchange: branches/1.4/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.

Modified: branches/1.4/main/file.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/main/file.c?view=diff&rev=60661&r1=60660&r2=60661
==============================================================================
--- branches/1.4/main/file.c (original)
+++ branches/1.4/main/file.c Sat Apr  7 20:40:47 2007
@@ -413,10 +413,15 @@
 				s->fmt = f;
 				s->trans = NULL;
 				s->filename = NULL;
-				if (s->fmt->format < AST_FORMAT_MAX_AUDIO)
+				if (s->fmt->format < AST_FORMAT_MAX_AUDIO) {
+					if (chan->stream)
+						ast_closestream(chan->stream);
 					chan->stream = s;
-				else
+				} else {
+					if (chan->vstream)
+						ast_closestream(chan->vstream);
 					chan->vstream = s;
+				}
 				free(fn);
 				break;
 			}
@@ -829,7 +834,7 @@
 		    open_wrapper(fs) ) {
 			ast_log(LOG_WARNING, "Unable to open %s\n", fn);
 			if (fs)
-				free(fs);
+				ast_free(fs);
 			if (bfile)
 				fclose(bfile);
 			free(fn);
@@ -945,7 +950,7 @@
 					unlink(orig_fn);
 				}
 				if (fs)
-					free(fs);
+					ast_free(fs);
 			}
 			fs->trans = NULL;
 			fs->fmt = f;



More information about the asterisk-commits mailing list