mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-04 18:57:38 +00:00
mpr: Fix double free in WNetGetResourceInformationA.
This commit is contained in:
parent
221d5aba3f
commit
afdd219194
|
@ -1684,7 +1684,7 @@ DWORD WINAPI WNetGetResourceInformationA( LPNETRESOURCEA lpNetResource,
|
|||
if (ret == WN_SUCCESS)
|
||||
{
|
||||
LPWSTR lpSystemW = NULL;
|
||||
LPVOID lpBufferW;
|
||||
NETRESOURCEW *lpBufferW;
|
||||
size = 1024;
|
||||
lpBufferW = HeapAlloc(GetProcessHeap(), 0, size);
|
||||
if (lpBufferW)
|
||||
|
@ -1705,12 +1705,10 @@ DWORD WINAPI WNetGetResourceInformationA( LPNETRESOURCEA lpNetResource,
|
|||
{
|
||||
ret = _thunkNetResourceArrayWToA(lpBufferW,
|
||||
&count, lpBuffer, cbBuffer);
|
||||
HeapFree(GetProcessHeap(), 0, lpNetResourceW);
|
||||
lpNetResourceW = lpBufferW;
|
||||
size = sizeof(NETRESOURCEA);
|
||||
size += WideCharToMultiByte(CP_ACP, 0, lpNetResourceW->lpRemoteName,
|
||||
size += WideCharToMultiByte(CP_ACP, 0, lpBufferW->lpRemoteName,
|
||||
-1, NULL, 0, NULL, NULL);
|
||||
size += WideCharToMultiByte(CP_ACP, 0, lpNetResourceW->lpProvider,
|
||||
size += WideCharToMultiByte(CP_ACP, 0, lpBufferW->lpProvider,
|
||||
-1, NULL, 0, NULL, NULL);
|
||||
|
||||
len = WideCharToMultiByte(CP_ACP, 0, lpSystemW,
|
||||
|
|
Loading…
Reference in a new issue