[Asterisk-cvs] asterisk/channels chan_zap.c,1.309,1.310

markster at lists.digium.com markster at lists.digium.com
Mon Jul 26 22:33:47 CDT 2004


Update of /usr/cvsroot/asterisk/channels
In directory localhost.localdomain:/tmp/cvs-serv8302/channels

Modified Files:
	chan_zap.c 
Log Message:
Make sure index >= 0 before initializing


Index: chan_zap.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_zap.c,v
retrieving revision 1.309
retrieving revision 1.310
diff -u -d -r1.309 -r1.310
--- chan_zap.c	27 Jul 2004 00:53:09 -0000	1.309
+++ chan_zap.c	27 Jul 2004 02:19:52 -0000	1.310
@@ -3750,6 +3750,13 @@
 	
 	index = zt_get_index(ast, p, 0);
 	
+	/* Hang up if we don't really exist */
+	if (index < 0)	{
+		ast_log(LOG_WARNING, "We dont exist?\n");
+		ast_mutex_unlock(&p->lock);
+		return NULL;
+	}
+	
 	p->subs[index].f.frametype = AST_FRAME_NULL;
 	p->subs[index].f.datalen = 0;
 	p->subs[index].f.samples = 0;
@@ -3761,13 +3768,6 @@
 	p->subs[index].f.src = "zt_read";
 	p->subs[index].f.data = NULL;
 	
-	/* Hang up if we don't really exist */
-	if (index < 0)	{
-		ast_log(LOG_WARNING, "We dont exist?\n");
-		ast_mutex_unlock(&p->lock);
-		return NULL;
-	}
-	
 	/* make sure it sends initial key state as first frame */
 	if (p->radio && (!p->firstradio))
 	{




More information about the svn-commits mailing list