about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorWill Song <incertia9474@gmail.com>2015-05-29 20:55:33 -0500
committerWill Song <incertia9474@gmail.com>2015-05-29 20:55:33 -0500
commit83bed119e4c5a39bc9f76640187db94dffac23cb (patch)
tree3d7d1c724944860bb9eb7a37d4c4ddc8e8c72a89
parent0e7507a1aa3390fe1899e3b4d705c823ff4011f8 (diff)
downloadprofani-tty-83bed119e4c5a39bc9f76640187db94dffac23cb.tar.gz
remove memory leak from creating a gdatetime string
-rw-r--r--src/ui/statusbar.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/ui/statusbar.c b/src/ui/statusbar.c
index c388a874..f3d204f1 100644
--- a/src/ui/statusbar.c
+++ b/src/ui/statusbar.c
@@ -132,6 +132,7 @@ status_bar_resize(void)
         gchar *date_fmt = g_date_time_format(last_time, time_pref);
         assert(date_fmt != NULL);
         size_t len = strlen(date_fmt);
+        g_free(date_fmt);
         if (g_strcmp0(time_pref, "") != 0) {
             /* 01234567890123456
              *  [HH:MM]  message */
@@ -309,6 +310,7 @@ status_bar_print_message(const char * const msg)
     gchar *date_fmt = g_date_time_format(last_time, time_pref);
     assert(date_fmt != NULL);
     size_t len = strlen(date_fmt);
+    g_free(date_fmt);
     if (g_strcmp0(time_pref, "") != 0) {
         mvwprintw(status_bar, 0, 5 + len, message);
     } else {