From c3847eec34476fa15d8bc50671f1377a0cb27fd8 Mon Sep 17 00:00:00 2001 From: Immae Date: Mon, 23 Jun 2014 12:05:49 +0200 Subject: Free some memory --- src/contact.c | 2 ++ src/ui/core.c | 1 + 2 files changed, 3 insertions(+) diff --git a/src/contact.c b/src/contact.c index 52942bec..839e7d10 100644 --- a/src/contact.c +++ b/src/contact.c @@ -240,6 +240,8 @@ _get_most_available_resource(PContact contact) resources = g_list_next(resources); } + free(resources); + free(current); return highest; } diff --git a/src/ui/core.c b/src/ui/core.c index 84fcebfd..30f79659 100644 --- a/src/ui/core.c +++ b/src/ui/core.c @@ -137,6 +137,7 @@ _ui_get_idle_time(void) XFree(info); return result; } + XFree(info); // if no libxss or xss idle time failed, use profanity idle time #endif gdouble seconds_elapsed = g_timer_elapsed(ui_idle_time, NULL); -- cgit 1.4.1-2-gfad0 From 83fc97621c2828d1fcbe20e95d258fdaab71c9eb Mon Sep 17 00:00:00 2001 From: James Booth Date: Tue, 24 Jun 2014 22:23:53 +0100 Subject: Check for null before freeing X11info, removed free current resource --- src/contact.c | 1 - src/ui/core.c | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/contact.c b/src/contact.c index 839e7d10..c57d1902 100644 --- a/src/contact.c +++ b/src/contact.c @@ -241,7 +241,6 @@ _get_most_available_resource(PContact contact) resources = g_list_next(resources); } free(resources); - free(current); return highest; } diff --git a/src/ui/core.c b/src/ui/core.c index 30f79659..254af048 100644 --- a/src/ui/core.c +++ b/src/ui/core.c @@ -137,7 +137,9 @@ _ui_get_idle_time(void) XFree(info); return result; } - XFree(info); + if (info != NULL) { + XFree(info); + } // if no libxss or xss idle time failed, use profanity idle time #endif gdouble seconds_elapsed = g_timer_elapsed(ui_idle_time, NULL); -- cgit 1.4.1-2-gfad0