[WINSPOOL] Properly fix a double free CORE-16715

Addendum to 0.4.14-dev-957-g
d90beaeed2

Many Thanks to the patches author Doug Lyons!
This commit is contained in:
Joachim Henze 2020-08-31 02:06:35 +02:00
parent 1f0bbb3050
commit dde92f8ffa

View file

@ -668,7 +668,7 @@ DocumentPropertiesA(HWND hWnd, HANDLE hPrinter, LPSTR pDeviceName, PDEVMODEA pDe
PWSTR pwszDeviceName = NULL;
PDEVMODEW pdmwInput = NULL;
PDEVMODEW pdmwOutput = NULL;
BOOL bReturnValue = -1;
LONG lReturnValue = -1;
DWORD cch;
FIXME("DocumentPropertiesA(%p, %p, %s, %p, %p, %lu)\n", hWnd, hPrinter, pDeviceName, pDevModeOutput, pDevModeInput, fMode);
@ -716,15 +716,10 @@ DocumentPropertiesA(HWND hWnd, HANDLE hPrinter, LPSTR pDeviceName, PDEVMODEA pDe
}
}
bReturnValue = DocumentPropertiesW(hWnd, hPrinter, pwszDeviceName, pdmwOutput, pdmwInput, fMode);
FIXME("bReturnValue from DocumentPropertiesW is '%ld'.\n", bReturnValue);
lReturnValue = DocumentPropertiesW(hWnd, hPrinter, pwszDeviceName, pdmwOutput, pdmwInput, fMode);
FIXME("lReturnValue from DocumentPropertiesW is '%ld'.\n", lReturnValue);
if (pwszDeviceName)
{
HeapFree(hProcessHeap, 0, pwszDeviceName);
}
if (bReturnValue < 0)
if (lReturnValue < 0)
{
FIXME("DocumentPropertiesW failed!\n");
goto Cleanup;
@ -745,7 +740,7 @@ Cleanup:
if (pdmwOutput)
HeapFree(hProcessHeap, 0, pdmwOutput);
return bReturnValue;
return lReturnValue;
}
PRINTER_INFO_9W * get_devmodeW(HANDLE hprn)