X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/127189ebecf34228120574d982a888f2f5fa27d4..b41b09e28513f8b30065914eeb1051a0a32e6e1b:/src/unix/gsocket.cpp

diff --git a/src/unix/gsocket.cpp b/src/unix/gsocket.cpp
index 8298938963..63bed5a32f 100644
--- a/src/unix/gsocket.cpp
+++ b/src/unix/gsocket.cpp
@@ -235,7 +235,7 @@ struct hostent * wxGethostbyname_r(const char *hostname, struct hostent *h,
 				   void *buffer, int size, int *err)
 
 {
-  struct hostent *he;
+  struct hostent *he = NULL;
   *err = 0;
 #if defined(HAVE_FUNC_GETHOSTBYNAME_R_6)
   if (gethostbyname_r(hostname, h, (char*)buffer, size, &he, err))
@@ -268,7 +268,7 @@ struct hostent * wxGethostbyaddr_r(const char *addr_buf, int buf_size,
 				   int proto, struct hostent *h,
 				   void *buffer, int size, int *err)
 {
-  struct hostent *he;
+  struct hostent *he = NULL;
   *err = 0;
 #if defined(HAVE_FUNC_GETHOSTBYNAME_R_6)
   if (gethostbyaddr_r(addr_buf, buf_size, proto, h,
@@ -299,7 +299,7 @@ struct hostent * wxGethostbyaddr_r(const char *addr_buf, int buf_size,
   return he;
 }
 
-#if defined(HAVE_GETHOSTBYNAME)
+#if defined(HAVE_GETSERVBYNAME)
 static struct servent * deepCopyServent(struct servent *s,
 					const struct servent *se,
 					char *buffer, int size)
@@ -338,7 +338,7 @@ static struct servent * deepCopyServent(struct servent *s,
 struct servent *wxGetservbyname_r(const char *port, const char *protocol,
 				  struct servent *serv, void *buffer, int size)
 {
-  struct servent *se;
+  struct servent *se = NULL;
 #if defined(HAVE_FUNC_GETSERVBYNAME_R_6)
   if (getservbyname_r(port, protocol, serv, (char*)buffer, size, &se))
     se = NULL;