Commit c820bddd authored by Marcus Meissner's avatar Marcus Meissner Committed by Alexandre Julliard

wbemprox: Fixed leaks in fill_datafile (Coverity).

parent 4903dda3
...@@ -1270,11 +1270,13 @@ static enum fill_status fill_datafile( struct table *table, const struct expr *c ...@@ -1270,11 +1270,13 @@ static enum fill_status fill_datafile( struct table *table, const struct expr *c
DWORD drives = GetLogicalDrives(); DWORD drives = GetLogicalDrives();
WIN32_FIND_DATAW data; WIN32_FIND_DATAW data;
HANDLE handle; HANDLE handle;
struct dirstack *dirstack = alloc_dirstack(2); struct dirstack *dirstack;
enum fill_status status = FILL_STATUS_UNFILTERED; enum fill_status status = FILL_STATUS_UNFILTERED;
if (!resize_table( table, 8, sizeof(*rec) )) return FILL_STATUS_FAILED; if (!resize_table( table, 8, sizeof(*rec) )) return FILL_STATUS_FAILED;
dirstack = alloc_dirstack(2);
for (i = 0; i < sizeof(drives); i++) for (i = 0; i < sizeof(drives); i++)
{ {
if (!(drives & (1 << i))) continue; if (!(drives & (1 << i))) continue;
...@@ -1300,6 +1302,7 @@ static enum fill_status fill_datafile( struct table *table, const struct expr *c ...@@ -1300,6 +1302,7 @@ static enum fill_status fill_datafile( struct table *table, const struct expr *c
if (!resize_table( table, row + 1, sizeof(*rec) )) if (!resize_table( table, row + 1, sizeof(*rec) ))
{ {
status = FILL_STATUS_FAILED; status = FILL_STATUS_FAILED;
FindClose( handle );
goto done; goto done;
} }
if (!strcmpW( data.cFileName, dotW ) || !strcmpW( data.cFileName, dotdotW )) continue; if (!strcmpW( data.cFileName, dotW ) || !strcmpW( data.cFileName, dotdotW )) continue;
...@@ -1309,6 +1312,7 @@ static enum fill_status fill_datafile( struct table *table, const struct expr *c ...@@ -1309,6 +1312,7 @@ static enum fill_status fill_datafile( struct table *table, const struct expr *c
{ {
if (push_dir( dirstack, new_path, len )) continue; if (push_dir( dirstack, new_path, len )) continue;
heap_free( new_path ); heap_free( new_path );
FindClose( handle );
status = FILL_STATUS_FAILED; status = FILL_STATUS_FAILED;
goto done; goto done;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment