aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLars Uebernickel <lars.uebernickel@canonical.com>2014-01-22 11:43:00 +0100
committerLars Uebernickel <lars.uebernickel@canonical.com>2014-01-22 11:43:00 +0100
commit2f5e7c9b93ea31fd7a123c845bc0e9a3632f4903 (patch)
treeb286544f898a49c0aa97a4a8a3d64b1485dc8b9d /src
parentfd8313fc612e355726546a5155c950e16040c134 (diff)
downloadayatana-indicator-power-2f5e7c9b93ea31fd7a123c845bc0e9a3632f4903.tar.gz
ayatana-indicator-power-2f5e7c9b93ea31fd7a123c845bc0e9a3632f4903.tar.bz2
ayatana-indicator-power-2f5e7c9b93ea31fd7a123c845bc0e9a3632f4903.zip
service.c: remove free() on uninitialized pointer
Diffstat (limited to 'src')
-rw-r--r--src/service.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/service.c b/src/service.c
index 7fead79..a2fc638 100644
--- a/src/service.c
+++ b/src/service.c
@@ -692,18 +692,20 @@ on_settings_activated (GSimpleAction * a G_GNUC_UNUSED,
GVariant * param G_GNUC_UNUSED,
gpointer gself G_GNUC_UNUSED)
{
- gchar *path;
if (!g_strcmp0 (g_getenv ("XDG_CURRENT_DESKTOP"), "Unity"))
{
+ gchar *path;
+
path = g_find_program_in_path ("unity-control-center");
if (path != NULL)
execute_command ("unity-control-center power");
else
execute_command ("gnome-control-center power");
+
+ g_free (path);
}
else if (!g_strcmp0 (g_getenv ("DESKTOP_SESSION"), "xubuntu"))
execute_command ("xfce4-power-manager-settings");
- g_free (path);
}
static void