From: David M. Lee Date: Wed, 5 Jun 2013 21:14:03 +0000 (+0000) Subject: Fixed refcounting problems with chanspy AMI support. X-Git-Tag: 13.0.0-beta1~1729 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a36d38ab388327d72fdf4d952415438bc4fa609f;p=thirdparty%2Fasterisk.git 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. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390584 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/manager_channels.c b/main/manager_channels.c index a66080cba5..b6eeb60b07 100644 --- a/main/manager_channels.c +++ b/main/manager_channels.c @@ -859,7 +859,7 @@ static void channel_chanspy_stop_cb(void *data, struct stasis_subscription *sub, 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 @@ static void channel_chanspy_start_cb(void *data, struct stasis_subscription *sub { 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");