Commit daaa4c40 authored by Bruno Jesus's avatar Bruno Jesus Committed by Alexandre Julliard

winspool: Fix a leak in DocumentPropertiesA (valgrind).

parent 5acf1510
......@@ -2361,7 +2361,7 @@ LONG WINAPI DocumentPropertiesA(HWND hWnd,HANDLE hPrinter,
LPSTR pDeviceName, LPDEVMODEA pDevModeOutput,
LPDEVMODEA pDevModeInput,DWORD fMode )
{
LPSTR lpName = pDeviceName;
LPSTR lpName = pDeviceName, dupname = NULL;
static CHAR port[] = "LPT1:";
LONG ret;
......@@ -2376,7 +2376,7 @@ LONG WINAPI DocumentPropertiesA(HWND hWnd,HANDLE hPrinter,
SetLastError(ERROR_INVALID_HANDLE);
return -1;
}
lpName = strdupWtoA(lpNameW);
lpName = dupname = strdupWtoA(lpNameW);
}
if (!GDI_CallExtDeviceMode16)
......@@ -2385,14 +2385,15 @@ LONG WINAPI DocumentPropertiesA(HWND hWnd,HANDLE hPrinter,
(LPCSTR)102 );
if (!GDI_CallExtDeviceMode16) {
ERR("No CallExtDeviceMode16?\n");
return -1;
ret = -1;
goto end;
}
}
ret = GDI_CallExtDeviceMode16(hWnd, pDevModeOutput, lpName, port,
pDevModeInput, NULL, fMode);
if(!pDeviceName)
HeapFree(GetProcessHeap(),0,lpName);
end:
HeapFree(GetProcessHeap(), 0, dupname);
return ret;
}
......
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