diff --git a/reactos/dll/win32/ws2_32/misc/ns.c b/reactos/dll/win32/ws2_32/misc/ns.c index d729dfceb34..9383d4e2198 100644 --- a/reactos/dll/win32/ws2_32/misc/ns.c +++ b/reactos/dll/win32/ws2_32/misc/ns.c @@ -1605,23 +1605,20 @@ getaddrinfo(const char FAR * nodename, struct sockaddr_in *sin; INT error; - if (res == NULL) - { - error = WSAEINVAL; - goto End; - } - if (nodename == NULL && servname == NULL) - { - error = WSAHOST_NOT_FOUND; - goto End; - } - if (!WSAINITIALIZED) { error = WSANOTINITIALISED; goto End; } + *res = NULL; + + if (nodename == NULL && servname == NULL) + { + error = WSAHOST_NOT_FOUND; + goto End; + } + if (servname) { /* converting port number */