[gnome-calendar] date-chooser-day: Automatically free the string



commit d76617f809a1d5c045f74e7772f17f546cab1b89
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Wed Apr 6 16:53:50 2022 +0200

    date-chooser-day: Automatically free the string

 src/gui/event-editor/gcal-date-chooser-day.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
---
diff --git a/src/gui/event-editor/gcal-date-chooser-day.c b/src/gui/event-editor/gcal-date-chooser-day.c
index 67695f2f..f7c04cf2 100644
--- a/src/gui/event-editor/gcal-date-chooser-day.c
+++ b/src/gui/event-editor/gcal-date-chooser-day.c
@@ -166,14 +166,13 @@ void
 gcal_date_chooser_day_set_date (GcalDateChooserDay *self,
                                 GDateTime          *date)
 {
-  gchar *text;
+  g_autofree gchar *text = NULL;
 
   g_clear_pointer (&self->date, g_date_time_unref);
   self->date = g_date_time_ref (date);
 
   text = g_strdup_printf ("%d", g_date_time_get_day_of_month (date));
   gtk_label_set_label (GTK_LABEL (self->label), text);
-  g_free (text);
 }
 
 GDateTime*


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]