Skip to content

Commit

Permalink
populate_commit_data_cache: Don't leak a floating GVariant
Browse files Browse the repository at this point in the history
var_variant_dup_to_gvariant() returns a floating GVariant, and
g_variant_get_child_value() won't sink it, so we need to free it.

Signed-off-by: Simon McVittie <[email protected]>
  • Loading branch information
smcv committed Feb 15, 2024
1 parent fd56fb8 commit a96834b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion common/flatpak-utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -3300,7 +3300,7 @@ populate_commit_data_cache (OstreeRepo *repo,
strcmp (m_key, "xa.data") != 0)
{
VarVariantRef v = var_metadata_entry_get_value (m);
GVariant *vv = var_variant_dup_to_gvariant (v);
g_autoptr(GVariant) vv = g_variant_ref_sink (var_variant_dup_to_gvariant (v));
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 a96834b

Please sign in to comment.