From c4f1adb7ccb8e6e4ba462712daee2bbacebae930 Mon Sep 17 00:00:00 2001 From: Misha Koshelev Date: Thu, 26 Jul 2007 00:03:25 -0500 Subject: [PATCH] urlmon/tests: Don't proceed with POST operation (that will fail) if we run out of memory. --- dlls/urlmon/tests/protocol.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dlls/urlmon/tests/protocol.c b/dlls/urlmon/tests/protocol.c index a9d13d15cef..45ba8410c81 100644 --- a/dlls/urlmon/tests/protocol.c +++ b/dlls/urlmon/tests/protocol.c @@ -159,6 +159,7 @@ static HRESULT WINAPI HttpNegotiate_BeginningTransaction(IHttpNegotiate2 *iface, addl_headers = CoTaskMemAlloc(sizeof(wszHeaders)); if (!addl_headers) { + http_post_test = FALSE; skip("Out of memory\n"); return E_OUTOFMEMORY; } @@ -504,18 +505,19 @@ static HRESULT WINAPI BindInfo_GetBindInfo(IInternetBindInfo *iface, DWORD *grfB if (http_post_test) { - pbindinfo->dwBindVerb = BINDVERB_POST; - pbindinfo->stgmedData.tymed = TYMED_HGLOBAL; /* Must be GMEM_FIXED, GMEM_MOVABLE does not work properly * with urlmon on native (Win98 and WinXP) */ pbindinfo->stgmedData.hGlobal = GlobalAlloc(GPTR, sizeof(szPostData)); if (!pbindinfo->stgmedData.hGlobal) { + http_post_test = FALSE; skip("Out of memory\n"); return E_OUTOFMEMORY; } lstrcpy((LPSTR)pbindinfo->stgmedData.hGlobal, szPostData); pbindinfo->cbstgmedData = sizeof(szPostData)-1; + pbindinfo->dwBindVerb = BINDVERB_POST; + pbindinfo->stgmedData.tymed = TYMED_HGLOBAL; } return S_OK;