From ebb3ff532d49211b7aeaf035554c4c2ac141a3e9 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Mon, 13 Aug 2018 17:16:03 +0200 Subject: [PATCH] Fix GVariant leak ostree_async_progress_get_variant returns a ref, so free it. Closes: #1964 Approved by: mwleeds --- common/flatpak-dir.c | 4 +++- common/flatpak-utils.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/common/flatpak-dir.c b/common/flatpak-dir.c index 6ca35602..666b1892 100644 --- a/common/flatpak-dir.c +++ b/common/flatpak-dir.c @@ -3437,9 +3437,11 @@ default_progress_changed (OstreeAsyncProgress *progress, } else { + g_autoptr(GVariant) outstanding_fetches = NULL; /* We get some extra calls before we've really started due to the initialization of the extra data, so ignore those */ - if (ostree_async_progress_get_variant (progress, "outstanding-fetches") == NULL) + outstanding_fetches = ostree_async_progress_get_variant (progress, "outstanding-fetches"); + if (outstanding_fetches == NULL) return; ostree_repo_pull_default_console_progress_changed (progress, user_data); diff --git a/common/flatpak-utils.c b/common/flatpak-utils.c index 5cebf737..3c2c460a 100644 --- a/common/flatpak-utils.c +++ b/common/flatpak-utils.c @@ -5429,10 +5429,12 @@ progress_cb (OstreeAsyncProgress *progress, gpointer user_data) guint requested; guint64 total_transferred; g_autofree gchar *formatted_bytes_total_transferred = NULL; + g_autoptr(GVariant) outstanding_fetchesv = NULL; /* We get some extra calls before we've really started due to the initialization of the extra data, so ignore those */ - if (ostree_async_progress_get_variant (progress, "outstanding-fetches") == NULL) + outstanding_fetchesv = ostree_async_progress_get_variant (progress, "outstanding-fetches"); + if (outstanding_fetchesv == NULL) return; buf = g_string_new ("");