Commit 614ad0c8 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

winspool: Fix potential string buffer leaks (Coverity).

parent a3aad9d8
...@@ -8565,17 +8565,17 @@ LPSTR WINAPI StartDocDlgA( HANDLE hPrinter, DOCINFOA *doc ) ...@@ -8565,17 +8565,17 @@ LPSTR WINAPI StartDocDlgA( HANDLE hPrinter, DOCINFOA *doc )
if (doc->lpszDocName) if (doc->lpszDocName)
{ {
docnameW = asciitounicode(&usBuffer, doc->lpszDocName); docnameW = asciitounicode(&usBuffer, doc->lpszDocName);
if (!(docW.lpszDocName = docnameW)) return NULL; if (!(docW.lpszDocName = docnameW)) goto failed;
} }
if (doc->lpszOutput) if (doc->lpszOutput)
{ {
outputW = asciitounicode(&usBuffer, doc->lpszOutput); outputW = asciitounicode(&usBuffer, doc->lpszOutput);
if (!(docW.lpszOutput = outputW)) return NULL; if (!(docW.lpszOutput = outputW)) goto failed;
} }
if (doc->lpszDatatype) if (doc->lpszDatatype)
{ {
datatypeW = asciitounicode(&usBuffer, doc->lpszDatatype); datatypeW = asciitounicode(&usBuffer, doc->lpszDatatype);
if (!(docW.lpszDatatype = datatypeW)) return NULL; if (!(docW.lpszDatatype = datatypeW)) goto failed;
} }
docW.fwType = doc->fwType; docW.fwType = doc->fwType;
...@@ -8589,6 +8589,7 @@ LPSTR WINAPI StartDocDlgA( HANDLE hPrinter, DOCINFOA *doc ) ...@@ -8589,6 +8589,7 @@ LPSTR WINAPI StartDocDlgA( HANDLE hPrinter, DOCINFOA *doc )
HeapFree(GetProcessHeap(), 0, retW); HeapFree(GetProcessHeap(), 0, retW);
} }
failed:
HeapFree(GetProcessHeap(), 0, datatypeW); HeapFree(GetProcessHeap(), 0, datatypeW);
HeapFree(GetProcessHeap(), 0, outputW); HeapFree(GetProcessHeap(), 0, outputW);
HeapFree(GetProcessHeap(), 0, docnameW); HeapFree(GetProcessHeap(), 0, docnameW);
......
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