From 9ca8f323a9c09ce0799833e9df9a4f23ab61945f Mon Sep 17 00:00:00 2001 From: Daiki Ueno Date: Fri, 20 Jul 2018 10:57:14 +0200 Subject: [PATCH] secret-session: Avoid double-free in service_encode_plain_secret() As g_variant_builder_add_value() takes ownership of a floating GVariant, we don't need to unref it afterwards. --- libsecret/secret-session.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/libsecret/secret-session.c b/libsecret/secret-session.c index 43bee9f..1860155 100644 --- a/libsecret/secret-session.c +++ b/libsecret/secret-session.c @@ -612,12 +612,10 @@ service_encode_plain_secret (SecretSession *session, child = g_variant_new_from_data (G_VARIANT_TYPE ("ay"), "", 0, TRUE, NULL, NULL); g_variant_builder_add_value (builder, child); - g_variant_unref (child); child = g_variant_new_from_data (G_VARIANT_TYPE ("ay"), secret, n_secret, TRUE, secret_value_unref, secret_value_ref (value)); g_variant_builder_add_value (builder, child); - g_variant_unref (child); g_variant_builder_add (builder, "s", secret_value_get_content_type (value)); return TRUE;