aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2012-04-09 14:13:25 -0500
committerCharles Kerr <charles.kerr@canonical.com>2012-04-09 14:13:25 -0500
commit6305fe39d22fed20516756f53168c73b9383a4f3 (patch)
tree77bb11c6abb2e72abfe28307a24deabd43bf2ecf
parent8e0baaf0e28ba90a464f487a2278174765164396 (diff)
downloadayatana-indicator-power-6305fe39d22fed20516756f53168c73b9383a4f3.tar.gz
ayatana-indicator-power-6305fe39d22fed20516756f53168c73b9383a4f3.tar.bz2
ayatana-indicator-power-6305fe39d22fed20516756f53168c73b9383a4f3.zip
leak fix 1 of 3: don't leak object_path and device_icon if kind == UP_DEVICE_KIND_LINE_POWER
-rw-r--r--src/indicator-power.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/indicator-power.c b/src/indicator-power.c
index 46adde7..4b3f85c 100644
--- a/src/indicator-power.c
+++ b/src/indicator-power.c
@@ -510,7 +510,7 @@ static GIcon*
get_device_icon (UpDeviceKind kind,
UpDeviceState state,
guint64 time_sec,
- gchar *device_icon)
+ const gchar *device_icon)
{
GIcon *gicon;
@@ -553,8 +553,8 @@ menu_add_device (GtkMenu *menu,
GtkWidget *details_label;
GtkWidget *grid;
GIcon *device_gicons;
- gchar *device_icon = NULL;
- gchar *object_path = NULL;
+ const gchar *device_icon = NULL;
+ const gchar *object_path = NULL;
gdouble percentage;
guint64 time;
const gchar *device_name;
@@ -567,7 +567,7 @@ menu_add_device (GtkMenu *menu,
return;
g_variant_get (device,
- "(susdut)",
+ "(&su&sdut)",
&object_path,
&kind,
&device_icon,
@@ -611,8 +611,6 @@ menu_add_device (GtkMenu *menu,
g_free (short_details);
g_free (details);
g_free (accessible_name);
- g_free (device_icon);
- g_free (object_path);
}
static gsize