mirror of
https://github.com/reactos/wine.git
synced 2024-11-23 20:00:00 +00:00
winspool: Fix potential string buffer leaks (Coverity).
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Huw Davies <huw@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
a3aad9d80f
commit
614ad0c8c2
@ -8565,17 +8565,17 @@ LPSTR WINAPI StartDocDlgA( HANDLE hPrinter, DOCINFOA *doc )
|
||||
if (doc->lpszDocName)
|
||||
{
|
||||
docnameW = asciitounicode(&usBuffer, doc->lpszDocName);
|
||||
if (!(docW.lpszDocName = docnameW)) return NULL;
|
||||
if (!(docW.lpszDocName = docnameW)) goto failed;
|
||||
}
|
||||
if (doc->lpszOutput)
|
||||
{
|
||||
outputW = asciitounicode(&usBuffer, doc->lpszOutput);
|
||||
if (!(docW.lpszOutput = outputW)) return NULL;
|
||||
if (!(docW.lpszOutput = outputW)) goto failed;
|
||||
}
|
||||
if (doc->lpszDatatype)
|
||||
{
|
||||
datatypeW = asciitounicode(&usBuffer, doc->lpszDatatype);
|
||||
if (!(docW.lpszDatatype = datatypeW)) return NULL;
|
||||
if (!(docW.lpszDatatype = datatypeW)) goto failed;
|
||||
}
|
||||
docW.fwType = doc->fwType;
|
||||
|
||||
@ -8589,6 +8589,7 @@ LPSTR WINAPI StartDocDlgA( HANDLE hPrinter, DOCINFOA *doc )
|
||||
HeapFree(GetProcessHeap(), 0, retW);
|
||||
}
|
||||
|
||||
failed:
|
||||
HeapFree(GetProcessHeap(), 0, datatypeW);
|
||||
HeapFree(GetProcessHeap(), 0, outputW);
|
||||
HeapFree(GetProcessHeap(), 0, docnameW);
|
||||
|
Loading…
Reference in New Issue
Block a user