Commit 6c477241 authored by Damien Fouilleul's avatar Damien Fouilleul

getaddrinfo.c: a word of warning ...

parent d68bf0d3
...@@ -498,6 +498,7 @@ static WSAAPI int _ws2_getnameinfo_bind( const struct sockaddr FAR * sa, socklen ...@@ -498,6 +498,7 @@ static WSAAPI int _ws2_getnameinfo_bind( const struct sockaddr FAR * sa, socklen
GETNAMEINFO entry = (GETNAMEINFO)ws2_find_api (TEXT("getnameinfo")); GETNAMEINFO entry = (GETNAMEINFO)ws2_find_api (TEXT("getnameinfo"));
if (entry != NULL) if (entry != NULL)
{ {
/* call API before replacing function pointer to avoid crash */
int result = entry (sa, salen, host, hostlen, serv, servlen, flags); int result = entry (sa, salen, host, hostlen, serv, servlen, flags);
ws2_getnameinfo = entry; ws2_getnameinfo = entry;
return result; return result;
...@@ -520,6 +521,7 @@ static WSAAPI int _ws2_getaddrinfo_bind(const char FAR *node, const char FAR *se ...@@ -520,6 +521,7 @@ static WSAAPI int _ws2_getaddrinfo_bind(const char FAR *node, const char FAR *se
if ((entry != NULL) && (freentry != NULL)) if ((entry != NULL) && (freentry != NULL))
{ {
/* call API before replacing function pointer to avoid crash */
int result = entry (node, service, hints, res); int result = entry (node, service, hints, res);
ws2_freeaddrinfo = freentry; ws2_freeaddrinfo = freentry;
ws2_getaddrinfo = entry; ws2_getaddrinfo = entry;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment