mlang: Fix memory leaks in error path (found by Smatch).
This commit is contained in:
parent
03f3a40a03
commit
8ae0d17d59
|
@ -634,10 +634,9 @@ HRESULT WINAPI ConvertINetString(
|
||||||
|
|
||||||
pDstStrW = HeapAlloc(GetProcessHeap(), 0, cDstSizeW * sizeof(WCHAR));
|
pDstStrW = HeapAlloc(GetProcessHeap(), 0, cDstSizeW * sizeof(WCHAR));
|
||||||
hr = ConvertINetMultiByteToUnicode(pdwMode, dwSrcEncoding, pSrcStr, pcSrcSize, pDstStrW, &cDstSizeW);
|
hr = ConvertINetMultiByteToUnicode(pdwMode, dwSrcEncoding, pSrcStr, pcSrcSize, pDstStrW, &cDstSizeW);
|
||||||
if (hr != S_OK)
|
if (hr == S_OK)
|
||||||
return hr;
|
hr = ConvertINetUnicodeToMultiByte(pdwMode, dwDstEncoding, pDstStrW, &cDstSizeW, pDstStr, pcDstSize);
|
||||||
|
|
||||||
hr = ConvertINetUnicodeToMultiByte(pdwMode, dwDstEncoding, pDstStrW, &cDstSizeW, pDstStr, pcDstSize);
|
|
||||||
HeapFree(GetProcessHeap(), 0, pDstStrW);
|
HeapFree(GetProcessHeap(), 0, pDstStrW);
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue