diff options
-rw-r--r-- | src/service.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/src/service.c b/src/service.c index 85d6202..b5227f6 100644 --- a/src/service.c +++ b/src/service.c @@ -338,11 +338,7 @@ create_header_state (IndicatorPowerService * self) g_variant_new_boolean (should_be_visible (self))); if (label != NULL) - { - g_variant_builder_add (&b, "{sv}", "label", g_variant_new_string (label)); - - g_free (label); - } + g_variant_builder_add (&b, "{sv}", "label", g_variant_new_take_string (label)); if (icon != NULL) { @@ -352,12 +348,7 @@ create_header_state (IndicatorPowerService * self) } if (a11y != NULL) - { - g_variant_builder_add (&b, "{sv}", "accessible-desc", - g_variant_new_string (a11y)); - - g_free (a11y); - } + g_variant_builder_add (&b, "{sv}", "accessible-desc", g_variant_new_take_string (a11y)); return g_variant_builder_end (&b); } |