[Freeswitch-svn] [commit] r12323 - freeswitch/trunk/libs/esl/src

FreeSWITCH SVN mrene at freeswitch.org
Fri Feb 27 07:38:33 PST 2009


Author: mrene
Date: Fri Feb 27 09:38:33 2009
New Revision: 12323

Log:
Avoiding segfault

Modified:
   freeswitch/trunk/libs/esl/src/esl.c

Modified: freeswitch/trunk/libs/esl/src/esl.c
==============================================================================
--- freeswitch/trunk/libs/esl/src/esl.c	(original)
+++ freeswitch/trunk/libs/esl/src/esl.c	Fri Feb 27 09:38:33 2009
@@ -381,8 +381,8 @@
 static void sock_setup(esl_handle_t *handle)
 {
 #ifdef WIN32
-	BOOL bOptVal = TRUE;
-	int bOptLen = sizeof(BOOL);
+	BOOL bOptVal = TRUE;
+	int bOptLen = sizeof(BOOL);
 	setsockopt(handle->sock, IPPROTO_TCP, TCP_NODELAY, (const char *)&bOptVal, bOptLen);
 #else
 	int x = 1;
@@ -712,7 +712,7 @@
 	int max, activity;
 	esl_status_t status = ESL_SUCCESS;
 
-	if (!handle->connected) {
+	if (!handle->connected || !handle || handle->sock == -1) {
 		return ESL_FAIL;
 	}
 



More information about the Freeswitch-svn mailing list