Skip to content

Commit

Permalink
lib/repo-finder-avahi: Fix a leak in a GVariantIter loop
Browse files Browse the repository at this point in the history
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 <[email protected]>

Closes: #1293
Approved by: cgwalters
  • Loading branch information
pwithnall authored and rh-atomic-bot committed Oct 19, 2017
1 parent e466e48 commit a1f020f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libostree/ostree-repo-finder-avahi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
{
Expand Down

0 comments on commit a1f020f

Please sign in to comment.