[asterisk-commits] branch 1.2 - commit revision 7224

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Nov 29 21:20:43 CST 2005


Author: kpfleming
Date: Tue Nov 29 21:20:42 2005
New Revision: 7224

URL: http://svn.digium.com/view/asterisk?rev=7224&view=rev
Log:
port memory leak fix from rev 7223 in trunk

Modified:
    branches/1.2/channel.c

Modified: branches/1.2/channel.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/channel.c?rev=7224&r1=7223&r2=7224&view=diff
==============================================================================
--- branches/1.2/channel.c (original)
+++ branches/1.2/channel.c Tue Nov 29 21:20:42 2005
@@ -1016,8 +1016,13 @@
 		return;
 
 	AST_LIST_TRAVERSE(&chan->spies->list, spy, list) {
-		if ((spy->type == type) && (spy->status == CHANSPY_RUNNING))
+		ast_mutex_lock(&spy->lock);
+		if ((spy->type == type) && (spy->status == CHANSPY_RUNNING)) {
 			spy->status = CHANSPY_DONE;
+			if (ast_test_flag(spy, CHANSPY_TRIGGER_MODE) != CHANSPY_TRIGGER_NONE)
+				ast_cond_signal(&spy->trigger);
+		}
+		ast_mutex_unlock(&spy->lock);
 	}
 }
 
@@ -3912,8 +3917,10 @@
 
 		if (need_dup)
 			result = ast_frdup(read_frame);
-		else
+		else {
 			result = read_frame;
+			ast_frfree(write_frame);
+		}
 	} else {
 		if (need_dup) {
 			result = ast_frdup(read_frame);



More information about the asterisk-commits mailing list