[PATCH] wbemprox: break out of loop when out of memory (Coverity)

Marcus Meissner meissner at suse.de
Mon Sep 3 12:23:25 CDT 2012


Hi,

unlikely, but just handle as breaking out of the loop.

CID718716

Ciao, Marcus
---
 dlls/wbemprox/builtin.c |    4 ++++
 1 Datei geändert, 4 Zeilen hinzugefügt(+)

diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c
index 19afa0c..bdf0e00 100644
--- a/dlls/wbemprox/builtin.c
+++ b/dlls/wbemprox/builtin.c
@@ -924,6 +924,10 @@ static void fill_service( struct table *table )
         service = OpenServiceW(manager, services[i].lpServiceName, GENERIC_READ);
         QueryServiceConfigW(service, NULL, 0, &size);
         config = heap_alloc(size);
+        if (!config) {
+            CloseServiceHandle(service);
+            break;
+        }
         if (QueryServiceConfigW(service, config, size, &size))
             startmode = config->dwStartType;
         else
-- 
1.7.10.4




More information about the wine-patches mailing list