[svn-commits] dlee: trunk r390584 - /trunk/main/manager_channels.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Jun 5 16:14:04 CDT 2013


Author: dlee
Date: Wed Jun  5 16:14:03 2013
New Revision: 390584

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=390584
Log:
Fixed refcounting problems with chanspy AMI support.

The ast_multi_channel_blob_get_channel function does not bump the refcount on
the channel snapshot that it returns. This is typical for Stasis message
payloads, since being immutable means that the object won't get unreffed out
from underneath you.

The manager code for chanspy was unreffing the snapshots it got out of the
multi-channel blob, which was one unref too many.

Modified:
    trunk/main/manager_channels.c

Modified: trunk/main/manager_channels.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/manager_channels.c?view=diff&rev=390584&r1=390583&r2=390584
==============================================================================
--- trunk/main/manager_channels.c (original)
+++ trunk/main/manager_channels.c Wed Jun  5 16:14:03 2013
@@ -859,7 +859,7 @@
 		struct stasis_topic *topic, struct stasis_message *message)
 {
 	RAII_VAR(struct ast_str *, spyer_channel_string, NULL, ast_free);
-	RAII_VAR(struct ast_channel_snapshot *, spyer, NULL, ao2_cleanup);
+	struct ast_channel_snapshot *spyer;
 	struct ast_multi_channel_blob *payload = stasis_message_data(message);
 
 	spyer = ast_multi_channel_blob_get_channel(payload, "spyer_channel");
@@ -883,8 +883,8 @@
 {
 	RAII_VAR(struct ast_str *, spyer_channel_string, NULL, ast_free);
 	RAII_VAR(struct ast_str *, spyee_channel_string, NULL, ast_free);
-	RAII_VAR(struct ast_channel_snapshot *, spyer, NULL, ao2_cleanup);
-	RAII_VAR(struct ast_channel_snapshot *, spyee, NULL, ao2_cleanup);
+	struct ast_channel_snapshot *spyer;
+	struct ast_channel_snapshot *spyee;
 	struct ast_multi_channel_blob *payload = stasis_message_data(message);
 
 	spyer = ast_multi_channel_blob_get_channel(payload, "spyer_channel");




More information about the svn-commits mailing list