From a9ab1c3e64481d4ea4cd6d540b0dc75b055193d1 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Sat, 17 Mar 2012 14:45:06 -0500 Subject: Fix variant leak in count_batteries() -- the returned value of g_variant_get_child_value() needs to be freed with g_variant_unref() when we're done with it. --- src/indicator-power.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/indicator-power.c b/src/indicator-power.c index ff56fda..d97ecdd 100644 --- a/src/indicator-power.c +++ b/src/indicator-power.c @@ -1040,6 +1040,8 @@ count_batteries(GVariant *devices, int *total, int *inuse) if ((state == UP_DEVICE_STATE_CHARGING) || (state == UP_DEVICE_STATE_DISCHARGING)) ++*inuse; } + + g_variant_unref (device); } g_debug("count_batteries found %d batteries (%d are charging/discharging)", *total, *inuse); -- cgit v1.2.3