Skip to content

Commit

Permalink
fm-tree-model: Fix use of memory after it is freed
Browse files Browse the repository at this point in the history
to avoid warning with Clang Analyzer
  • Loading branch information
sc0w committed Mar 5, 2019
1 parent 7c9ae01 commit 1848d37
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/file-manager/fm-tree-model.c
Expand Up @@ -779,9 +779,13 @@ stop_monitoring_directory (FMTreeModel *model, TreeNode *node)
static void
destroy_children_without_reporting (FMTreeModel *model, TreeNode *parent)
{
while (parent->first_child != NULL)
TreeNode *current_child = parent->first_child;
TreeNode *next_child;
while (current_child != NULL)
{
destroy_node_without_reporting (model, parent->first_child);
next_child = current_child->next;
destroy_node_without_reporting (model, current_child);
current_child = next_child;
}
}

Expand Down

0 comments on commit 1848d37

Please sign in to comment.