Skip to content

Commit

Permalink
populate_commit_data_cache: Don't leak child value
Browse files Browse the repository at this point in the history
g_variant_get_child_value() returns a non-floating reference, so
g_variant_builder_add() will not sink it.

Signed-off-by: Simon McVittie <[email protected]>
  • Loading branch information
smcv committed Feb 15, 2024
1 parent b97704d commit fd56fb8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion common/flatpak-utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -3301,7 +3301,8 @@ populate_commit_data_cache (OstreeRepo *repo,
{
VarVariantRef v = var_metadata_entry_get_value (m);
GVariant *vv = var_variant_dup_to_gvariant (v);
g_variant_builder_add (&sparse_builder, "{sv}", m_key, g_variant_get_child_value (vv, 0));
g_autoptr(GVariant) child = g_variant_get_child_value (vv, 0);
g_variant_builder_add (&sparse_builder, "{sv}", m_key, child);
has_sparse = TRUE;
}
}
Expand Down

0 comments on commit fd56fb8

Please sign in to comment.