[asterisk-commits] jrose: branch 1.8 r311197 - /branches/1.8/apps/app_chanspy.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Mar 17 14:03:40 CDT 2011


Author: jrose
Date: Thu Mar 17 14:03:34 2011
New Revision: 311197

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=311197
Log:
This fixes a nasty chanspy bug which was causing a channel leak every time a spied on channel made a call.

In addition to the above, it makes certain channel destruction occurs so that applications don't get stuck waiting for datastore destruction while monitored by chanspy.

(closes issue #18742)
Reported by: jkister
Tested by: jkister, jcovert, jrose

Review: http://reviewboard.digium.internal/r/106/


Modified:
    branches/1.8/apps/app_chanspy.c

Modified: branches/1.8/apps/app_chanspy.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/apps/app_chanspy.c?view=diff&rev=311197&r1=311196&r2=311197
==============================================================================
--- branches/1.8/apps/app_chanspy.c (original)
+++ branches/1.8/apps/app_chanspy.c Thu Mar 17 14:03:34 2011
@@ -707,6 +707,7 @@
 		struct ast_autochan *autochan, struct ast_channel *chan)
 {
 	struct ast_channel *next;
+	struct ast_autochan *autochan_store;
 	const size_t pseudo_len = strlen("DAHDI/pseudo");
 
 	if (!iter) {
@@ -724,7 +725,10 @@
 		goto redo;
 	}
 
-	return ast_autochan_setup(next);
+	autochan_store = ast_autochan_setup(next);
+	ast_channel_unref(next);
+
+	return autochan_store;
 }
 
 static int common_exec(struct ast_channel *chan, struct ast_flags *flags,




More information about the asterisk-commits mailing list