From: Stefan Neis Date: Sat, 14 Jan 2006 13:30:58 +0000 (+0000) Subject: Ensure "reasonable" return values even if none of the #ifdef conditions in X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/539ae551cfe2812d481f57db7e0abbd9bb056ea5 Ensure "reasonable" return values even if none of the #ifdef conditions in wxGet{host,serv}by{name,addr}_r matches. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36873 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/unix/gsocket.cpp b/src/unix/gsocket.cpp index 8298938963..1ea7b594e5 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, @@ -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;