Fix memory leak when opening file browser

The name string of each file was duplicated but not freed. The new flag to
ensure the file-list frees the name wasn't set. Mistake in ca475479eb.
This commit is contained in:
Julian Eisel 2021-01-22 16:57:02 +01:00
parent bbe6d44928
commit 3469e06c1a
1 changed files with 7 additions and 1 deletions

View File

@ -1954,7 +1954,13 @@ static FileDirEntry *filelist_file_create_entry(FileList *filelist, const int in
ret->entry = rev;
ret->relpath = BLI_strdup(entry->relpath);
ret->name = entry->free_name ? BLI_strdup(entry->name) : entry->name;
if (entry->free_name) {
ret->name = BLI_strdup(entry->name);
ret->flags |= FILE_ENTRY_NAME_FREE;
}
else {
ret->name = entry->name;
}
ret->description = BLI_strdupcat(filelist->filelist.root, entry->relpath);
memcpy(ret->uuid, entry->uuid, sizeof(ret->uuid));
ret->blentype = entry->blentype;