projects
/
ostree.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
521e0ec
)
Fix leak in ostree_repo_list_collection_refs
author
Alexander Larsson
<alexl@redhat.com>
Mon, 13 Aug 2018 15:44:27 +0000
(17:44 +0200)
committer
Atomic Bot
<atomic-devel@projectatomic.io>
Mon, 13 Aug 2018 16:29:59 +0000
(16:29 +0000)
We need to have the g_auto(GLnxDirFdIterator) inside the loop, or
we don't correctly clean up when iterating several times.
Closes: #1700
Approved by: cgwalters
src/libostree/ostree-repo-refs.c
patch
|
blob
|
history
diff --git
a/src/libostree/ostree-repo-refs.c
b/src/libostree/ostree-repo-refs.c
index b38489c4b7635722fb9c803acaf062e47eb51b70..1bbe39016d01cbed8d558155ead69f7725a51174 100644
(file)
--- a/
src/libostree/ostree-repo-refs.c
+++ b/
src/libostree/ostree-repo-refs.c
@@
-1251,7
+1251,6
@@
ostree_repo_list_collection_refs (OstreeRepo *self,
(GDestroyNotify) ostree_collection_ref_free,
g_free);
- g_auto(GLnxDirFdIterator) dfd_iter = { 0, };
g_autoptr(GString) base_path = g_string_new ("");
const gchar *main_collection_id = ostree_repo_get_collection_id (self);
@@
-1277,6
+1276,8
@@
ostree_repo_list_collection_refs (OstreeRepo *self,
{
const char *refs_dir = *iter;
gboolean refs_dir_exists = FALSE;
+ g_auto(GLnxDirFdIterator) dfd_iter = { 0, };
+
if (!ot_dfd_iter_init_allow_noent (self->repo_dir_fd, refs_dir,
&dfd_iter, &refs_dir_exists, error))
return FALSE;