Fix GVariant leak

ostree_async_progress_get_variant returns a ref, so free it.

Closes: #1964
Approved by: mwleeds
This commit is contained in:
Alexander Larsson
2018-08-13 17:16:03 +02:00
committed by Atomic Bot
parent 7df3f9f1ba
commit ebb3ff532d
2 changed files with 6 additions and 2 deletions

View File

@@ -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);

View File

@@ -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 ("");