It is plain wrong to perform g_strdup() after call to xfce_rc_close: returned pointer can be invalidated. So we do g_strdup() early and aren't relying on the fact that xfce_rc_read_entry() will return the different pointers after successive invocations. Signed-off: Eygene Ryabinkin, --- panel-plugin/datetime.c.orig 2008-11-01 00:23:04.000000000 +0300 +++ panel-plugin/datetime.c 2008-11-01 00:30:00.000000000 +0300 @@ -597,7 +597,8 @@ gchar *file; XfceRc *rc; t_layout layout; - const gchar *date_font, *time_font, *date_format, *time_format; + gchar *date_font, *time_font, *date_format, *time_format; + const gchar *rc_val; /* load defaults */ layout = LAYOUT_DATE_TIME; @@ -615,20 +616,19 @@ if(rc != NULL) { layout = xfce_rc_read_int_entry(rc, "layout", layout); - date_font = xfce_rc_read_entry(rc, "date_font", date_font); - 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); + rc_val = xfce_rc_read_entry(rc, "date_font", date_font); + date_font = g_strdup(rc_val); + rc_val = xfce_rc_read_entry(rc, "time_font", time_font); + time_font = g_strdup(rc_val); + rc_val = xfce_rc_read_entry(rc, "date_format", date_format); + date_format = g_strdup(rc_val); + rc_val = xfce_rc_read_entry(rc, "time_format", time_format); + time_format = g_strdup(rc_val); xfce_rc_close(rc); } } - date_font = g_strdup(date_font); - time_font = g_strdup(time_font); - date_format = g_strdup(date_format); - time_format = g_strdup(time_format); - /* set values in dt struct */ datetime_apply_layout(dt, layout); datetime_apply_font(dt, date_font, time_font);