[asterisk-commits] twilson: trunk r315674 - /trunk/channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Apr 26 18:04:15 CDT 2011


Author: twilson
Date: Tue Apr 26 18:04:10 2011
New Revision: 315674

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=315674
Log:
Make sure to create the caps structure for autocreated peers

Because crashing is bad.

Modified:
    trunk/channels/chan_sip.c

Modified: trunk/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_sip.c?view=diff&rev=315674&r1=315673&r2=315674
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Tue Apr 26 18:04:10 2011
@@ -26226,6 +26226,11 @@
 		return NULL;
 	}
 
+	if (!(peer->caps = ast_format_cap_alloc_nolock())) {
+		ao2_t_ref(peer, -1, "failed to allocate format capabilities, drop peer");
+		return NULL;
+	}
+
 	ast_atomic_fetchadd_int(&apeerobjs, 1);
 	set_peer_defaults(peer);
 




More information about the asterisk-commits mailing list