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.
This commit is contained in:
Richard Hughes 2018-09-19 16:16:15 +01:00
parent 19ba35c844
commit 34fcc02052

View File

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