[SVCHOST]
[reactos.git] / reactos / base / services / svchost / svchost.c
index 01eaec2..0c9b484 100644 (file)
@@ -701,10 +701,10 @@ GetServiceDllFunction (
 
     /* Next, get the address being looked up*/
     lpAddress = GetProcAddress(hModule, lpProcName);
-    if (!lpAddress)
+    if (!lpAddress && lpdwError)
     {
         /* We couldn't find it, write the error code and a debug statement */
-        if (lpdwError) *lpdwError = GetLastError();
+        *lpdwError = GetLastError();
         DBG_ERR("GetProcAddress (%s) failed on DLL %ws.  Error %d.\n",
                 lpProcName,
                 pDll->pszDllPath,