Commit a21c489f authored by Marcus Meissner's avatar Marcus Meissner Committed by Alexandre Julliard

mmsystem.dll16: Free the correct pointer (Coverity).

parent ba8caceb
...@@ -323,12 +323,14 @@ static MMSYSTEM_MapType MCI_MapMsg16To32W(WORD wMsg, DWORD dwFlags, DWORD_PTR* l ...@@ -323,12 +323,14 @@ static MMSYSTEM_MapType MCI_MapMsg16To32W(WORD wMsg, DWORD dwFlags, DWORD_PTR* l
return MMSYSTEM_MAP_OKMEM; return MMSYSTEM_MAP_OKMEM;
case MCI_SYSINFO: case MCI_SYSINFO:
{ {
MCI_SYSINFO_PARMSW *origmsip32w;
MCI_SYSINFO_PARMSW *msip32w = HeapAlloc(GetProcessHeap(), 0, sizeof(MCI_OPEN_PARMS16 *) + sizeof(MCI_SYSINFO_PARMSW)); MCI_SYSINFO_PARMSW *msip32w = HeapAlloc(GetProcessHeap(), 0, sizeof(MCI_OPEN_PARMS16 *) + sizeof(MCI_SYSINFO_PARMSW));
MCI_SYSINFO_PARMS16 *msip16 = MapSL(*lParam); MCI_SYSINFO_PARMS16 *msip16 = MapSL(*lParam);
if (!msip32w) if (!msip32w)
return MMSYSTEM_MAP_NOMEM; return MMSYSTEM_MAP_NOMEM;
origmsip32w = msip32w;
*(MCI_SYSINFO_PARMS16 **)msip32w = msip16; *(MCI_SYSINFO_PARMS16 **)msip32w = msip16;
msip32w = (MCI_SYSINFO_PARMSW *)((char *)msip32w + sizeof(MCI_OPEN_PARMS16 *)); msip32w = (MCI_SYSINFO_PARMSW *)((char *)msip32w + sizeof(MCI_OPEN_PARMS16 *));
msip32w->dwCallback = msip16->dwCallback; msip32w->dwCallback = msip16->dwCallback;
...@@ -337,7 +339,7 @@ static MMSYSTEM_MapType MCI_MapMsg16To32W(WORD wMsg, DWORD dwFlags, DWORD_PTR* l ...@@ -337,7 +339,7 @@ static MMSYSTEM_MapType MCI_MapMsg16To32W(WORD wMsg, DWORD dwFlags, DWORD_PTR* l
msip16->dwRetSize * sizeof(WCHAR)); msip16->dwRetSize * sizeof(WCHAR));
if (!msip32w->lpstrReturn) if (!msip32w->lpstrReturn)
{ {
HeapFree(GetProcessHeap(), 0, msip32w); HeapFree(GetProcessHeap(), 0, origmsip32w);
return MMSYSTEM_MAP_NOMEM; return MMSYSTEM_MAP_NOMEM;
} }
msip32w->dwRetSize = (dwFlags & MCI_SYSINFO_QUANTITY) ? sizeof(DWORD) : msip16->dwRetSize; msip32w->dwRetSize = (dwFlags & MCI_SYSINFO_QUANTITY) ? sizeof(DWORD) : msip16->dwRetSize;
......
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