mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-14 23:07:47 +00:00
localui: Fix a memory leak.
This commit is contained in:
parent
f6120c2aa4
commit
64bcb540bb
|
@ -503,7 +503,6 @@ static BOOL WINAPI localui_AddPortUI(PCWSTR pName, HWND hWnd, PCWSTR pMonitorNam
|
||||||
{
|
{
|
||||||
addportui_t data;
|
addportui_t data;
|
||||||
HANDLE hXcv;
|
HANDLE hXcv;
|
||||||
LPWSTR ptr = NULL;
|
|
||||||
DWORD needed;
|
DWORD needed;
|
||||||
DWORD dummy;
|
DWORD dummy;
|
||||||
DWORD status;
|
DWORD status;
|
||||||
|
@ -529,14 +528,11 @@ static BOOL WINAPI localui_AddPortUI(PCWSTR pName, HWND hWnd, PCWSTR pMonitorNam
|
||||||
(PBYTE) &dummy, 0, &needed, &status);
|
(PBYTE) &dummy, 0, &needed, &status);
|
||||||
|
|
||||||
TRACE("got %u with status %u\n", res, status);
|
TRACE("got %u with status %u\n", res, status);
|
||||||
if (res && (status == ERROR_SUCCESS)) {
|
if (res && (status == ERROR_SUCCESS) && ppPortName) {
|
||||||
/* Native localui uses GlobalAlloc also.
|
/* Native localui uses GlobalAlloc also.
|
||||||
The caller must GlobalFree the buffer */
|
The caller must GlobalFree the buffer */
|
||||||
ptr = GlobalAlloc(GPTR, (lstrlenW(data.portname)+1) * sizeof(WCHAR));
|
*ppPortName = GlobalAlloc(GPTR, (lstrlenW(data.portname)+1) * sizeof(WCHAR));
|
||||||
if (ptr) {
|
if (*ppPortName) lstrcpyW(*ppPortName, data.portname);
|
||||||
lstrcpyW(ptr, data.portname);
|
|
||||||
if (ppPortName) *ppPortName = ptr;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (res && (status == ERROR_ALREADY_EXISTS)) {
|
if (res && (status == ERROR_ALREADY_EXISTS)) {
|
||||||
|
|
Loading…
Reference in a new issue