From c7f158824f41f37168222cb09a12c385d98315c3 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Sun, 24 Oct 2010 11:09:42 +0100 Subject: [PATCH] winspool.drv: Check return value of EnumPrintersA. --- dlls/winspool.drv/info.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dlls/winspool.drv/info.c b/dlls/winspool.drv/info.c index 4a084d185fc..4ffe092944b 100644 --- a/dlls/winspool.drv/info.c +++ b/dlls/winspool.drv/info.c @@ -964,8 +964,7 @@ void WINSPOOL_LoadSystemPrinters(void) printers AddPrinter takes a while. So we'll tag all printers that were automatically added last time around, if they still exist we'll leave them be otherwise we'll delete them. */ - EnumPrintersA(PRINTER_ENUM_LOCAL, NULL, 5, NULL, 0, &needed, &num); - if(needed) { + if (EnumPrintersA(PRINTER_ENUM_LOCAL, NULL, 5, NULL, 0, &needed, &num) && needed) { PRINTER_INFO_5A* pi = HeapAlloc(GetProcessHeap(), 0, needed); if(EnumPrintersA(PRINTER_ENUM_LOCAL, NULL, 5, (LPBYTE)pi, needed, &needed, &num)) { for(i = 0; i < num; i++) {