[PATCH] wbemprox: fixed leaking dirstack (Coverity)

Marcus Meissner marcus at jet.franken.de
Thu Jun 20 15:44:00 CDT 2013


second issue, curios enough two CIDs.

1030109 Resource leak
1030112 Resource leak
        Just allocate dirstack a bit later to avoid the leak.

Ciao, Marcus
---
 dlls/wbemprox/builtin.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c
index 3cf47f8..9e2369a 100644
--- a/dlls/wbemprox/builtin.c
+++ b/dlls/wbemprox/builtin.c
@@ -1273,11 +1273,13 @@ static enum fill_status fill_directory( struct table *table, const struct expr *
     DWORD drives = GetLogicalDrives();
     WIN32_FIND_DATAW data;
     HANDLE handle;
-    struct dirstack *dirstack = alloc_dirstack(2);
+    struct dirstack *dirstack;
     enum fill_status status = FILL_STATUS_UNFILTERED;
 
     if (!resize_table( table, 4, sizeof(*rec) )) return FILL_STATUS_FAILED;
 
+    dirstack = alloc_dirstack(2);
+
     for (i = 0; i < sizeof(drives); i++)
     {
         if (!(drives & (1 << i))) continue;
-- 
1.7.10.4




More information about the wine-patches mailing list