mirror of
https://github.com/flatpak/flatpak.git
synced 2026-05-24 00:41:00 -04:00
Fix some leaks
g_variant_dict_end() returns a floating reference, we have to sink it before using it with a g_autoptr.
This commit is contained in:
@@ -2418,7 +2418,7 @@ flatpak_dir_pull_extra_data (FlatpakDir *self,
|
||||
|
||||
g_variant_dict_init (&new_metadata_dict, detached_metadata);
|
||||
g_variant_dict_insert_value (&new_metadata_dict, "xa.extra-data", extra_data);
|
||||
new_detached_metadata = g_variant_dict_end (&new_metadata_dict);
|
||||
new_detached_metadata = g_variant_ref_sink (g_variant_dict_end (&new_metadata_dict));
|
||||
|
||||
/* There is a commitmeta size limit when pulling, so we have to side-load it
|
||||
when installing in the system repo */
|
||||
|
||||
@@ -3338,7 +3338,7 @@ flatpak_repo_update (OstreeRepo *repo,
|
||||
"s", collection_ref.collection_id);
|
||||
g_variant_dict_insert_value (new_summary_commit_dict, "ostree.ref-binding",
|
||||
g_variant_new_strv ((const gchar * const *) &collection_ref.ref_name, 1));
|
||||
new_summary_commit = g_variant_dict_end (new_summary_commit_dict);
|
||||
new_summary_commit = g_variant_ref_sink (g_variant_dict_end (new_summary_commit_dict));
|
||||
|
||||
if (!ostree_repo_prepare_transaction (repo, NULL, cancellable, error))
|
||||
goto out;
|
||||
@@ -3968,7 +3968,7 @@ flatpak_repo_generate_appstream (OstreeRepo *repo,
|
||||
"s", (collection_id != NULL) ? collection_id : "");
|
||||
g_variant_dict_insert_value (metadata_dict, "ostree.ref-binding",
|
||||
g_variant_new_strv ((const gchar * const *) &branch, 1));
|
||||
metadata = g_variant_dict_end (metadata_dict);
|
||||
metadata = g_variant_ref_sink (g_variant_dict_end (metadata_dict));
|
||||
|
||||
if (timestamp > 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user