aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2013-09-11 11:40:40 -0500
committerCharles Kerr <charles.kerr@canonical.com>2013-09-11 11:40:40 -0500
commit4ca541cc16b60f29a03694034900c30b4d8a5cbd (patch)
tree43625044ae598e87832fa50cd001a50d8ef5f306 /src
parentce4067c8054de62ac8f54676103253312d80396f (diff)
downloadayatana-indicator-power-4ca541cc16b60f29a03694034900c30b4d8a5cbd.tar.gz
ayatana-indicator-power-4ca541cc16b60f29a03694034900c30b4d8a5cbd.tar.bz2
ayatana-indicator-power-4ca541cc16b60f29a03694034900c30b4d8a5cbd.zip
use g_variant_new_take_string() where appropriate
Diffstat (limited to 'src')
-rw-r--r--src/service.c13
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);
}