From 901e7c665005aff317b056e34c3fc5dadb9a1a04 Mon Sep 17 00:00:00 2001 From: Uwe Bonnes Date: Mon, 11 Jul 2005 10:23:10 +0000 Subject: [PATCH] URLMonikerImpl_BindToStorage: Don't use a HeapAllocated pointer for other purposes. --- dlls/urlmon/umon.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/dlls/urlmon/umon.c b/dlls/urlmon/umon.c index 56828d7fbe9..9df80452088 100644 --- a/dlls/urlmon/umon.c +++ b/dlls/urlmon/umon.c @@ -598,7 +598,7 @@ static HRESULT WINAPI URLMonikerImpl_BindToStorage(IMoniker* iface, if(SUCCEEDED(hres)) { WCHAR *urlcopy, *tmpwc; URL_COMPONENTSW url; - WCHAR *host, *path, *user, *pass; + WCHAR *host, *path, *partial_path, *user, *pass; DWORD lensz = sizeof(bind->expected_size); DWORD dwService = 0; BOOL bSuccess; @@ -797,9 +797,9 @@ static HRESULT WINAPI URLMonikerImpl_BindToStorage(IMoniker* iface, break; case INTERNET_SCHEME_FILE: - path = bind->URLName + 5; /* Skip the "file:" part */ - if ((path[0] != '/' && path[0] != '\\') || - (path[1] != '/' && path[1] != '\\')) + partial_path = bind->URLName + 5; /* Skip the "file:" part */ + if ((partial_path[0] != '/' && partial_path[0] != '\\') || + (partial_path[1] != '/' && partial_path[1] != '\\')) { hres = E_FAIL; } @@ -807,10 +807,10 @@ static HRESULT WINAPI URLMonikerImpl_BindToStorage(IMoniker* iface, { HANDLE h; - path += 2; - if (path[0] == '/' || path[0] == '\\') - ++path; - h = CreateFileW(path, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0 ); + partial_path += 2; + if (partial_path[0] == '/' || partial_path[0] == '\\') + ++partial_path; + h = CreateFileW(partial_path, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0 ); if (h == (HANDLE) HFILE_ERROR) { hres = HRESULT_FROM_WIN32(GetLastError()); -- 2.11.4.GIT