mpr: Fix some memory leaks.

This commit is contained in:
Andrew Talbot 2008-06-25 22:42:04 +01:00 committed by Alexandre Julliard
parent 7bd0c43f03
commit 69789d5891

View file

@ -1312,6 +1312,7 @@ DWORD WINAPI WNetGetResourceInformationA( LPNETRESOURCEA lpNetResource,
ret = _thunkNetResourceArrayAToW(lpNetResource, &count, lpNetResourceW, &size);
if (ret == WN_MORE_DATA)
{
HeapFree(GetProcessHeap(), 0, lpNetResourceW);
lpNetResourceW = HeapAlloc(GetProcessHeap(), 0, size);
if (lpNetResourceW)
ret = _thunkNetResourceArrayAToW(lpNetResource,
@ -1343,6 +1344,7 @@ 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,