Hans Leidekker : wbemprox: Fix some memory leaks (Coverity).

Alexandre Julliard julliard at wine.codeweavers.com
Mon Jun 22 07:44:59 CDT 2015


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

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Mon Jun 22 12:13:30 2015 +0200

wbemprox: Fix some memory leaks (Coverity).

---

 dlls/wbemprox/builtin.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c
index b55e9ad..0c6f8a7 100644
--- a/dlls/wbemprox/builtin.c
+++ b/dlls/wbemprox/builtin.c
@@ -1586,6 +1586,8 @@ static enum fill_status fill_datafile( struct table *table, const struct expr *c
 
         for (;;)
         {
+            heap_free( glob );
+            heap_free( path );
             path = pop_dir( dirstack, &len );
             if (!(glob = build_glob( root[0], path, len )))
             {
@@ -1635,8 +1637,6 @@ static enum fill_status fill_datafile( struct table *table, const struct expr *c
                 FindClose( handle );
             }
             if (!peek_dir( dirstack )) break;
-            heap_free( glob );
-            heap_free( path );
         }
     }
 
@@ -1678,6 +1678,8 @@ static enum fill_status fill_directory( struct table *table, const struct expr *
 
         for (;;)
         {
+            heap_free( glob );
+            heap_free( path );
             path = pop_dir( dirstack, &len );
             if (!(glob = build_glob( root[0], path, len )))
             {
@@ -1728,8 +1730,6 @@ static enum fill_status fill_directory( struct table *table, const struct expr *
                 FindClose( handle );
             }
             if (!peek_dir( dirstack )) break;
-            heap_free( glob );
-            heap_free( path );
         }
     }
 




More information about the wine-cvs mailing list