[asterisk-commits] kharwell: trunk r398017 - in /trunk: ./ apps/app_mixmonitor.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Aug 30 11:27:58 CDT 2013


Author: kharwell
Date: Fri Aug 30 11:27:57 2013
New Revision: 398017

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=398017
Log:
Fix memory leaks

(closes issue ASTERISK-22368)
Reported by: Corey Farrell
Patches:
     issueA22368_mixmonitor_free_filename.patch uploaded by wdoekes (license 5674)
........

Merged revisions 398004 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 398011 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 398016 from http://svn.asterisk.org/svn/asterisk/branches/12

Modified:
    trunk/   (props changed)
    trunk/apps/app_mixmonitor.c

Propchange: trunk/
------------------------------------------------------------------------------
--- branch-12-merged (original)
+++ branch-12-merged Fri Aug 30 11:27:57 2013
@@ -1,1 +1,1 @@
-/branches/12:1-397989,398002
+/branches/12:1-397989,398002,398016

Modified: trunk/apps/app_mixmonitor.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_mixmonitor.c?view=diff&rev=398017&r1=398016&r2=398017
==============================================================================
--- trunk/apps/app_mixmonitor.c (original)
+++ trunk/apps/app_mixmonitor.c Fri Aug 30 11:27:57 2013
@@ -137,7 +137,7 @@
 				<variable name="MIXMONITOR_FILENAME">
 					<para>Will contain the filename used to record.</para>
 				</variable>
-			</variablelist>	
+			</variablelist>
 		</description>
 		<see-also>
 			<ref type="application">Monitor</ref>
@@ -404,7 +404,7 @@
 	ast_audiohook_destroy(&mixmonitor->audiohook);
 }
 
-static int startmon(struct ast_channel *chan, struct ast_audiohook *audiohook) 
+static int startmon(struct ast_channel *chan, struct ast_audiohook *audiohook)
 {
 	int res = 0;
 
@@ -496,12 +496,14 @@
 		if (mixmonitor->mixmonitor_ds) {
 			ast_mutex_destroy(&mixmonitor->mixmonitor_ds->lock);
 			ast_cond_destroy(&mixmonitor->mixmonitor_ds->destruction_condition);
-			ast_free(mixmonitor->filename_write);
-			ast_free(mixmonitor->filename_read);
 			ast_free(mixmonitor->mixmonitor_ds);
-			ast_free(mixmonitor->name);
-			ast_free(mixmonitor->post_process);
-		}
+		}
+
+		ast_free(mixmonitor->name);
+		ast_free(mixmonitor->post_process);
+		ast_free(mixmonitor->filename);
+		ast_free(mixmonitor->filename_write);
+		ast_free(mixmonitor->filename_read);
 
 		/* Free everything in the recipient list */
 		clear_mixmonitor_recipient_list(mixmonitor);
@@ -586,7 +588,7 @@
 	}
 }
 
-static void *mixmonitor_thread(void *obj) 
+static void *mixmonitor_thread(void *obj)
 {
 	struct mixmonitor *mixmonitor = obj;
 	char *fs_ext = "";




More information about the asterisk-commits mailing list