From d57036f6a2da1adbc581a258d3e128c4b0623baf Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Mon, 28 Nov 2016 17:21:59 +0100 Subject: [PATCH] delta compilation: Fix leak We need to ref-sik the new varian for g_autoptr to work Closes: #597 Approved by: cgwalters --- .../ostree-repo-static-delta-compilation.c | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/libostree/ostree-repo-static-delta-compilation.c b/src/libostree/ostree-repo-static-delta-compilation.c index 4b0bc507..22c45e6d 100644 --- a/src/libostree/ostree-repo-static-delta-compilation.c +++ b/src/libostree/ostree-repo-static-delta-compilation.c @@ -1532,17 +1532,17 @@ ostree_repo_static_delta_generate (OstreeRepo *self, /* floating */ GVariant *to_csum_v = ostree_checksum_to_bytes_v (to); - delta_descriptor = g_variant_new ("(@a{sv}t@ay@ay@" OSTREE_COMMIT_GVARIANT_STRING "ay" - "a" OSTREE_STATIC_DELTA_META_ENTRY_FORMAT - "@a" OSTREE_STATIC_DELTA_FALLBACK_FORMAT ")", - g_variant_builder_end (&metadata_builder), - GUINT64_TO_BE (g_date_time_to_unix (now)), - from_csum_v, - to_csum_v, - to_commit, - g_variant_builder_new (G_VARIANT_TYPE ("ay")), - part_headers, - fallback_headers); + delta_descriptor = g_variant_ref_sink (g_variant_new ("(@a{sv}t@ay@ay@" OSTREE_COMMIT_GVARIANT_STRING "ay" + "a" OSTREE_STATIC_DELTA_META_ENTRY_FORMAT + "@a" OSTREE_STATIC_DELTA_FALLBACK_FORMAT ")", + g_variant_builder_end (&metadata_builder), + GUINT64_TO_BE (g_date_time_to_unix (now)), + from_csum_v, + to_csum_v, + to_commit, + g_variant_builder_new (G_VARIANT_TYPE ("ay")), + part_headers, + fallback_headers)); g_date_time_unref (now); }