tree: Fix name memory leak

Coverity points out that we have a memory leak from `g_strdup(name)`.
`insert_child_mtree()` takes a const char * and duplicates it.
`name` can be passed directly to `insert_child_mtree()`.
This commit is contained in:
Luke Yang 2024-06-12 15:50:54 -04:00
parent 0ea7d2e326
commit dc9eaef1e5

View File

@ -452,7 +452,7 @@ ostree_mutable_tree_ensure_parent_dirs (OstreeMutableTree *self, GPtrArray *spli
invalidate_contents_checksum (subdir);
next = ostree_mutable_tree_new ();
ostree_mutable_tree_set_metadata_checksum (next, metadata_checksum);
insert_child_mtree (subdir, g_strdup (name), next);
insert_child_mtree (subdir, name, next);
}
subdir = next;