[Xfce4-commits] <xfce4-weather-plugin:master> Return NULL for missing keys when reading cache file.

Harald Judt noreply at xfce.org
Sat Jan 5 12:04:16 CET 2013


Updating branch refs/heads/master
         to 5d80b9fe0ba2a83f07dbbce9de9efb52e4987c5a (commit)
       from 00b6dbcaf3f4274f56fe08e3a0a7fbdd2f0975a4 (commit)

commit 5d80b9fe0ba2a83f07dbbce9de9efb52e4987c5a
Author: Harald Judt <h.judt at gmx.at>
Date:   Sat Jan 5 01:51:20 2013 +0100

    Return NULL for missing keys when reading cache file.
    
    Not doing this could cause double frees when trying to read keys missing
    in the cache file.

 panel-plugin/weather.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/panel-plugin/weather.c b/panel-plugin/weather.c
index b313dad..2feb502 100644
--- a/panel-plugin/weather.c
+++ b/panel-plugin/weather.c
@@ -71,8 +71,7 @@
         g_key_file_free(keyfile);
 
 #define CACHE_READ_STRING(var, key)                             \
-    if (g_key_file_has_key(keyfile, group, key, NULL))          \
-        var = g_key_file_get_string(keyfile, group, key, NULL);
+    var = g_key_file_get_string(keyfile, group, key, NULL);     \
 
 #define SCHEDULE_WAKEUP_COMPARE(var, reason)        \
     if (difftime(var, now_t) < diff) {              \


More information about the Xfce4-commits mailing list