winspool: Fix a leak in DocumentPropertiesA (valgrind).

oldstable
Bruno Jesus 2014-07-07 21:12:25 -03:00 committed by Alexandre Julliard
parent 5acf1510fb
commit daaa4c40d4
1 changed files with 6 additions and 5 deletions

View File

@ -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;
}