[asterisk-commits] rmudgett: trunk r308623 - in /trunk: ./ channels/sig_pri.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Feb 23 17:45:07 CST 2011


Author: rmudgett
Date: Wed Feb 23 17:45:02 2011
New Revision: 308623

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=308623
Log:
Merged revisions 308622 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r308622 | rmudgett | 2011-02-23 17:38:04 -0600 (Wed, 23 Feb 2011) | 9 lines
  
  sig_pri_new_ast_channel() should return NULL when new_ast_channel() fails.
  
  (closes issue #18874)
  Reported by: cmaj
  Patches:
        patch-sig_pri-crash-possible-null-channel-pointer.diff.txt uploaded by cmaj (license 830)
  
  JIRA SWP-3172
........

Modified:
    trunk/   (props changed)
    trunk/channels/sig_pri.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.

Modified: trunk/channels/sig_pri.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/sig_pri.c?view=diff&rev=308623&r1=308622&r2=308623
==============================================================================
--- trunk/channels/sig_pri.c (original)
+++ trunk/channels/sig_pri.c Wed Feb 23 17:45:02 2011
@@ -884,10 +884,14 @@
 {
 	struct ast_channel *c;
 
-	if (p->calls->new_ast_channel)
+	if (p->calls->new_ast_channel) {
 		c = p->calls->new_ast_channel(p->chan_pvt, state, ulaw, exten, requestor);
-	else
+	} else {
 		return NULL;
+	}
+	if (!c) {
+		return NULL;
+	}
 
 	if (!p->owner)
 		p->owner = c;




More information about the asterisk-commits mailing list