diff --git a/dlls/winhttp/session.c b/dlls/winhttp/session.c index 660eae57ebb..97e763e49f1 100644 --- a/dlls/winhttp/session.c +++ b/dlls/winhttp/session.c @@ -1365,7 +1365,11 @@ BOOL WINAPI WinHttpDetectAutoProxyConfigUrl( DWORD flags, LPWSTR *url ) FIXME("getaddrinfo not found at build time\n"); #endif } - if (!ret) set_last_error( ERROR_WINHTTP_AUTODETECTION_FAILED ); + if (!ret) + { + set_last_error( ERROR_WINHTTP_AUTODETECTION_FAILED ); + *url = NULL; + } return ret; } diff --git a/dlls/winhttp/tests/winhttp.c b/dlls/winhttp/tests/winhttp.c index 3157a44684e..19bd4292412 100644 --- a/dlls/winhttp/tests/winhttp.c +++ b/dlls/winhttp/tests/winhttp.c @@ -2759,7 +2759,7 @@ if (0) /* crashes on some win2k systems */ if (!ret) { ok( error == ERROR_WINHTTP_AUTODETECTION_FAILED, "got %u\n", error ); - ok( url == (WCHAR *)0xdeadbeef, "got %p\n", url ); + ok( !url || broken(url == (WCHAR *)0xdeadbeef), "got %p\n", url ); } else { @@ -2774,7 +2774,7 @@ if (0) /* crashes on some win2k systems */ if (!ret) { ok( error == ERROR_WINHTTP_AUTODETECTION_FAILED, "got %u\n", error ); - ok( url == (WCHAR *)0xdeadbeef, "got %p\n", url ); + ok( !url || broken(url == (WCHAR *)0xdeadbeef), "got %p\n", url ); } else {