Huw Davies : winspool: Pre-1. 6 versions of CUPS can leave behind a file when cupsGetPDD3 fails, so clear up afterwards.

Alexandre Julliard julliard at winehq.org
Fri Nov 16 13:12:51 CST 2012


Module: wine
Branch: master
Commit: 02d41b7b1a605dfbb42f2d13225dc05549bf61f7
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=02d41b7b1a605dfbb42f2d13225dc05549bf61f7

Author: Huw Davies <huw at codeweavers.com>
Date:   Fri Nov 16 09:53:14 2012 +0000

winspool: Pre-1.6 versions of CUPS can leave behind a file when cupsGetPDD3 fails, so clear up afterwards.

---

 dlls/winspool.drv/info.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/dlls/winspool.drv/info.c b/dlls/winspool.drv/info.c
index af336cb..172f892 100644
--- a/dlls/winspool.drv/info.c
+++ b/dlls/winspool.drv/info.c
@@ -833,11 +833,14 @@ static BOOL get_cups_ppd( const char *printer_name, const WCHAR *ppd )
 
     http_status = cupsGetPPD3_wrapper( 0, printer_name, &modtime,
                                        unix_name, strlen( unix_name ) + 1 );
+
+    if (http_status != HTTP_OK) unlink( unix_name );
     HeapFree( GetProcessHeap(), 0, unix_name );
 
     if (http_status == HTTP_OK) return TRUE;
 
-    TRACE( "failed to get ppd for printer %s from cups, calling fallback\n", debugstr_a(printer_name) );
+    TRACE( "failed to get ppd for printer %s from cups (status %d), calling fallback\n",
+           debugstr_a(printer_name), http_status );
     return get_fallback_ppd( printer_name, ppd );
 }
 




More information about the wine-cvs mailing list