From 34fcc0205275d56a06c4cf5a8c684d6362a0bbde Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Wed, 19 Sep 2018 16:16:15 +0100 Subject: [PATCH] trivial: Fix a tiny memory leak on startup The property value is a floating reference, and so if we're not using it as a parameter to g_variant_new() we need to unref it manually. --- src/fu-main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/fu-main.c b/src/fu-main.c index da630d143..fdbe2c709 100644 --- a/src/fu-main.c +++ b/src/fu-main.c @@ -125,8 +125,10 @@ fu_main_emit_property_changed (FuMainPrivate *priv, GVariantBuilder invalidated_builder; /* not yet connected */ - if (priv->connection == NULL) + if (priv->connection == NULL) { + g_variant_unref (g_variant_ref_sink (property_value)); return; + } /* build the dict */ g_variant_builder_init (&invalidated_builder, G_VARIANT_TYPE ("as"));