Commit 8b55b76d authored by Robert Reif's avatar Robert Reif Committed by Alexandre Julliard

Fix memory leak in error path.

parent cf4d0d97
......@@ -1458,7 +1458,11 @@ DWORD WINAPI mciSendStringA(LPCSTR lpstrCommand, LPSTR lpstrRet,
if (lpstrRet)
{
lpwstrRet = HeapAlloc(GetProcessHeap(), 0, uRetLen * sizeof(WCHAR));
if (!lpwstrRet) return MCIERR_OUT_OF_MEMORY;
if (!lpwstrRet) {
WARN("no memory\n");
HeapFree( GetProcessHeap(), 0, lpwstrCommand );
return MCIERR_OUT_OF_MEMORY;
}
}
ret = mciSendStringW(lpwstrCommand, lpwstrRet, uRetLen, hwndCallback);
if (lpwstrRet)
......
......@@ -166,6 +166,7 @@ static DWORD wodOpen(LPDWORD lpdwUser, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
if (dwFlags & WAVE_MAPPED) {
if (lpDesc->uMappedDeviceID >= ndhi) {
WARN("invalid parameter: dwFlags WAVE_MAPPED\n");
HeapFree(GetProcessHeap(), 0, wom);
return MMSYSERR_INVALPARAM;
}
ndlo = lpDesc->uMappedDeviceID;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment