From 2a99324f597755c8acfdff217960c68353c29d52 Mon Sep 17 00:00:00 2001 From: Monsta Date: Sun, 16 Nov 2014 16:41:16 +0300 Subject: don't leak memory Closes https://github.com/mate-desktop/mate-power-manager/pull/115 --- src/gpm-main.c | 2 +- src/gpm-manager.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gpm-main.c b/src/gpm-main.c index 71ba598..30cf481 100644 --- a/src/gpm-main.c +++ b/src/gpm-main.c @@ -243,7 +243,7 @@ main (int argc, char *argv[]) if (!gpm_object_register (session_connection, G_OBJECT (manager))) { egg_error ("%s is already running in this session.", GPM_NAME); - return 0; + goto unref_program; } /* register to be a policy agent, just like kpackagekit does */ diff --git a/src/gpm-manager.c b/src/gpm-manager.c index 09bd0c0..9024d37 100644 --- a/src/gpm-manager.c +++ b/src/gpm-manager.c @@ -1673,8 +1673,10 @@ gpm_manager_engine_charge_action_cb (GpmEngine *engine, UpDevice *device, GpmMan } /* not all types have actions */ - if (title == NULL) + if (title == NULL) { + g_free (message); return; + } /* get correct icon */ icon = gpm_upower_get_device_icon (device); -- cgit v1.2.1