[Goodies-commits] r5484 - in xfce4-datetime-plugin/trunk: . panel-plugin

Diego Ongaro ongardie at xfce.org
Sun Sep 28 05:55:22 CEST 2008


Author: ongardie
Date: 2008-09-28 03:55:22 +0000 (Sun, 28 Sep 2008)
New Revision: 5484

Modified:
   xfce4-datetime-plugin/trunk/ChangeLog
   xfce4-datetime-plugin/trunk/panel-plugin/datetime.c
Log:
Fix memory access after free

Modified: xfce4-datetime-plugin/trunk/ChangeLog
===================================================================
--- xfce4-datetime-plugin/trunk/ChangeLog	2008-09-27 16:17:58 UTC (rev 5483)
+++ xfce4-datetime-plugin/trunk/ChangeLog	2008-09-28 03:55:22 UTC (rev 5484)
@@ -1,3 +1,7 @@
+2008-09-27	Diego Ongaro <ongardie at gmail.com>
+
+	* panel-plugin/datetime.c: Fix memory access after free
+
 2008-07-02	Diego Ongaro <ongardie at gmail.com>
 
 	* *: 0.6.0 release

Modified: xfce4-datetime-plugin/trunk/panel-plugin/datetime.c
===================================================================
--- xfce4-datetime-plugin/trunk/panel-plugin/datetime.c	2008-09-27 16:17:58 UTC (rev 5483)
+++ xfce4-datetime-plugin/trunk/panel-plugin/datetime.c	2008-09-28 03:55:22 UTC (rev 5484)
@@ -595,7 +595,7 @@
 static void datetime_read_rc_file(XfcePanelPlugin *plugin, t_datetime *dt)
 {
   gchar *file;
-  XfceRc *rc;
+  XfceRc *rc = NULL;
   t_layout layout;
   const gchar *date_font, *time_font, *date_format, *time_format;
 
@@ -619,8 +619,6 @@
       time_font   = xfce_rc_read_entry(rc, "time_font", time_font);
       date_format = xfce_rc_read_entry(rc, "date_format", date_format);
       time_format = xfce_rc_read_entry(rc, "time_format", time_format);
-
-      xfce_rc_close(rc);
     }
   }
 
@@ -629,6 +627,9 @@
   date_format = g_strdup(date_format);
   time_format = g_strdup(time_format);
 
+  if(rc != NULL)
+    xfce_rc_close(rc);
+
   /* set values in dt struct */
   datetime_apply_layout(dt, layout);
   datetime_apply_font(dt, date_font, time_font);




More information about the Goodies-commits mailing list