[asterisk-commits] sgriepentrog: branch 1.8 r406721 - /branches/1.8/main/rtp_engine.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jan 28 10:36:52 CST 2014


Author: sgriepentrog
Date: Tue Jan 28 10:36:46 2014
New Revision: 406721

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=406721
Log:
rtp_engine: improved handling of get_rtp_info failure

In ast_rtp_instance_make_compatible(), after a failure of
channel tech call get_rtp_info() to return peer_instance,
the null pointer would be passed to ao2_ref, producing an
error that looked like a refernce counting problem but is
not.  This patch corrects that and adds helpful LOG_ERROR
messages to indicate which failure path occurred.


Modified:
    branches/1.8/main/rtp_engine.c

Modified: branches/1.8/main/rtp_engine.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/main/rtp_engine.c?view=diff&rev=406721&r1=406720&r2=406721
==============================================================================
--- branches/1.8/main/rtp_engine.c (original)
+++ branches/1.8/main/rtp_engine.c Tue Jan 28 10:36:46 2014
@@ -1697,11 +1697,15 @@
 	}
 
 	glue->get_rtp_info(peer, &peer_instance);
-
-	if (!peer_instance || peer_instance->engine != instance->engine) {
+	if (!peer_instance) {
+		ast_log(LOG_ERROR, "Unable to get_rtp_info for peer type %s\n", glue->type);
+		ast_channel_unlock(peer);
+		return -1;
+	}
+	if (peer_instance->engine != instance->engine) {
+		ast_log(LOG_ERROR, "Peer engine mismatch for type %s\n", glue->type);
 		ast_channel_unlock(peer);
 		ao2_ref(peer_instance, -1);
-		peer_instance = NULL;
 		return -1;
 	}
 




More information about the asterisk-commits mailing list