Nikolay Sivov : winspool: Fix potential string buffer leaks (Coverity).
Module: wine Branch: master Commit: 614ad0c8c284d6a75039704fe8340b542d7a02f4 URL: http://source.winehq.org/git/wine.git/?a=commit;h=614ad0c8c284d6a75039704fe8... Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Dec 22 13:02:02 2016 +0300 winspool: Fix potential string buffer leaks (Coverity). Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winspool.drv/info.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dlls/winspool.drv/info.c b/dlls/winspool.drv/info.c index 2c6a816..f09745d 100644 --- a/dlls/winspool.drv/info.c +++ b/dlls/winspool.drv/info.c @@ -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);
participants (1)
-
Alexandre Julliard