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
This commit is contained in:
Philip Withnall 2017-10-19 14:04:10 +01:00 committed by Atomic Bot
parent e466e482b1
commit a1f020ffa4

View File

@ -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))
{