[Xfce4-commits] <xfce4-weather-plugin:master> xfceweather_read_config(): Don't check if we can free a string.

Harald Judt noreply at xfce.org
Tue Dec 11 21:56:01 CET 2012


Updating branch refs/heads/master
         to b1c9ebe6d764402c72e3fd9d2ed2b52e2362a7c1 (commit)
       from 86b750772d763836dd80584eaa25b0cb40a404c0 (commit)

commit b1c9ebe6d764402c72e3fd9d2ed2b52e2362a7c1
Author: Harald Judt <h.judt at gmx.at>
Date:   Mon Dec 10 22:38:49 2012 +0100

    xfceweather_read_config(): Don't check if we can free a string.
    
    g_free() doesn't complain if the string is NULL, so remove those
    unnecessary checks.

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

diff --git a/panel-plugin/weather.c b/panel-plugin/weather.c
index ca422c1..c57ec47 100644
--- a/panel-plugin/weather.c
+++ b/panel-plugin/weather.c
@@ -547,25 +547,19 @@ xfceweather_read_config(XfcePanelPlugin *plugin,
 
     value = xfce_rc_read_entry(rc, "loc_name", NULL);
     if (value) {
-        if (data->location_name)
-            g_free(data->location_name);
-
+        g_free(data->location_name);
         data->location_name = g_strdup(value);
     }
 
     value = xfce_rc_read_entry(rc, "lat", NULL);
     if (value) {
-        if (data->lat)
-            g_free(data->lat);
-
+        g_free(data->lat);
         data->lat = g_strdup(value);
     }
 
     value = xfce_rc_read_entry(rc, "lon", NULL);
     if (value) {
-        if (data->lon)
-            g_free(data->lon);
-
+        g_free(data->lon);
         data->lon = g_strdup(value);
     }
 


More information about the Xfce4-commits mailing list