about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2014-06-24 22:23:53 +0100
committerJames Booth <boothj5@gmail.com>2014-06-24 22:23:53 +0100
commit83fc97621c2828d1fcbe20e95d258fdaab71c9eb (patch)
tree7ec969c7598056387e74b05f7f8d9beff467b784
parentc3847eec34476fa15d8bc50671f1377a0cb27fd8 (diff)
downloadprofani-tty-83fc97621c2828d1fcbe20e95d258fdaab71c9eb.tar.gz
Check for null before freeing X11info, removed free current resource
-rw-r--r--src/contact.c1
-rw-r--r--src/ui/core.c4
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);