Fix memory leak in error path.
This commit is contained in:
parent
cf4d0d9707
commit
8b55b76daf
|
@ -1458,7 +1458,11 @@ DWORD WINAPI mciSendStringA(LPCSTR lpstrCommand, LPSTR lpstrRet,
|
||||||
if (lpstrRet)
|
if (lpstrRet)
|
||||||
{
|
{
|
||||||
lpwstrRet = HeapAlloc(GetProcessHeap(), 0, uRetLen * sizeof(WCHAR));
|
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);
|
ret = mciSendStringW(lpwstrCommand, lpwstrRet, uRetLen, hwndCallback);
|
||||||
if (lpwstrRet)
|
if (lpwstrRet)
|
||||||
|
|
|
@ -166,6 +166,7 @@ static DWORD wodOpen(LPDWORD lpdwUser, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
|
||||||
if (dwFlags & WAVE_MAPPED) {
|
if (dwFlags & WAVE_MAPPED) {
|
||||||
if (lpDesc->uMappedDeviceID >= ndhi) {
|
if (lpDesc->uMappedDeviceID >= ndhi) {
|
||||||
WARN("invalid parameter: dwFlags WAVE_MAPPED\n");
|
WARN("invalid parameter: dwFlags WAVE_MAPPED\n");
|
||||||
|
HeapFree(GetProcessHeap(), 0, wom);
|
||||||
return MMSYSERR_INVALPARAM;
|
return MMSYSERR_INVALPARAM;
|
||||||
}
|
}
|
||||||
ndlo = lpDesc->uMappedDeviceID;
|
ndlo = lpDesc->uMappedDeviceID;
|
||||||
|
|
Loading…
Reference in New Issue