[Freeswitch-trunk] [commit] r13550 - freeswitch/trunk/src

FreeSWITCH SVN anthm at freeswitch.org
Tue Jun 2 11:30:19 PDT 2009


Author: anthm
Date: Tue Jun  2 13:30:18 2009
New Revision: 13550

Log:
rupa said this segged

Modified:
   freeswitch/trunk/src/switch_utils.c

Modified: freeswitch/trunk/src/switch_utils.c
==============================================================================
--- freeswitch/trunk/src/switch_utils.c	(original)
+++ freeswitch/trunk/src/switch_utils.c	Tue Jun  2 13:30:18 2009
@@ -747,7 +747,7 @@
 {
 	struct ifaddrs *ifaddrs, *i = NULL;
 
-	if (getifaddrs(&ifaddrs) < 0) {
+	if (!me || getifaddrs(&ifaddrs) < 0) {
 		return -1;
 	}	
 
@@ -755,7 +755,7 @@
 		struct sockaddr_in *s = (struct sockaddr_in *)i->ifa_addr;
 		struct sockaddr_in *m = (struct sockaddr_in *)i->ifa_netmask;
 
-		if (s->sin_addr.s_addr == me->sin_addr.s_addr) {
+		if (s && m && s->sin_addr.s_addr == me->sin_addr.s_addr) {
 			*mask = m->sin_addr.s_addr;
 			return 0;
 		}



More information about the Freeswitch-trunk mailing list