diff options
author | Philip Withnall <withnall@endlessm.com> | 2017-10-19 14:04:10 +0100 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2017-10-19 13:16:59 +0000 |
commit | a1f020ffa45f9cb7dad86e4c87a3f78b6f47997c (patch) | |
tree | a33a55d625bdfebb0c93c9626527e902b77e8aed /src/libostree/ostree-repo-finder-avahi.c | |
parent | e466e482b156ad89c1dea8bcb0a5ee639f18e884 (diff) | |
download | ostree-a1f020ffa45f9cb7dad86e4c87a3f78b6f47997c.tar.gz |
lib/repo-finder-avahi: Fix a leak in a GVariantIter loop
Use g_variant_iter_loop() rather than next(), since it automatically
handles freeing the child memory each iteration. Previously, we leaked
it for all but the last iteration.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
Closes: #1293
Approved by: cgwalters
Diffstat (limited to 'src/libostree/ostree-repo-finder-avahi.c')
-rw-r--r-- | src/libostree/ostree-repo-finder-avahi.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libostree/ostree-repo-finder-avahi.c b/src/libostree/ostree-repo-finder-avahi.c index a39d9533..0c88ad60 100644 --- a/src/libostree/ostree-repo-finder-avahi.c +++ b/src/libostree/ostree-repo-finder-avahi.c @@ -429,7 +429,7 @@ fill_refs_and_checksums_from_summary_map (GVariantIter *summary_map, g_autofree gchar *ref_name = NULL; g_autoptr(GVariant) checksum_variant = NULL; - while (g_variant_iter_next (summary_map, "(s(t@aya{sv}))", + while (g_variant_iter_loop (summary_map, "(s(t@aya{sv}))", (gpointer *) &ref_name, NULL, (gpointer *) &checksum_variant, NULL)) { |