[PATCH] wbemprox: always free 'new_path'.
Serge Gautherie
winehq-git_serge_180711 at gautherie.fr
Sat Nov 16 05:03:42 CST 2019
Signed-off-by: Serge Gautherie <winehq-git_serge_180711 at gautherie.fr>
---
dlls/wbemprox/builtin.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c
index 96d1e0b..56d7d67 100644
--- a/dlls/wbemprox/builtin.c
+++ b/dlls/wbemprox/builtin.c
@@ -2341,7 +2341,9 @@ static enum fill_status fill_datafile( struct table *table, const struct expr *c
goto done;
}
if (!wcscmp( data.cFileName, dotW ) || !wcscmp( data.cFileName, dotdotW )) continue;
+
new_path = append_path( path, data.cFileName, &len );
+ /* FIXME: What if new_path == NULL? */
if (data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
{
@@ -2354,6 +2356,7 @@ static enum fill_status fill_datafile( struct table *table, const struct expr *c
rec = (struct record_datafile *)(table->data + offset);
rec->name = build_name( root[0], new_path );
rec->version = get_file_version( rec->name );
+ heap_free( new_path );
if (!match_row( table, row, cond, &status ))
{
free_row_values( table, row );
@@ -2466,6 +2469,8 @@ static enum fill_status fill_directory( struct table *table, const struct expr *
continue;
new_path = append_path( path, data.cFileName, &len );
+ /* FIXME: What if new_path == NULL? */
+
if (!(push_dir( dirstack, new_path, len )))
{
heap_free( new_path );
@@ -2476,6 +2481,7 @@ static enum fill_status fill_directory( struct table *table, const struct expr *
rec = (struct record_directory *)(table->data + offset);
rec->accessmask = FILE_ALL_ACCESS;
rec->name = build_name( root[0], new_path );
+ heap_free( new_path );
if (!match_row( table, row, cond, &status ))
{
free_row_values( table, row );
--
2.10.0.windows.1
More information about the wine-devel
mailing list