mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-25 14:56:23 +00:00
remove memory leak from creating a gdatetime string
This commit is contained in:
@@ -132,6 +132,7 @@ status_bar_resize(void)
|
|||||||
gchar *date_fmt = g_date_time_format(last_time, time_pref);
|
gchar *date_fmt = g_date_time_format(last_time, time_pref);
|
||||||
assert(date_fmt != NULL);
|
assert(date_fmt != NULL);
|
||||||
size_t len = strlen(date_fmt);
|
size_t len = strlen(date_fmt);
|
||||||
|
g_free(date_fmt);
|
||||||
if (g_strcmp0(time_pref, "") != 0) {
|
if (g_strcmp0(time_pref, "") != 0) {
|
||||||
/* 01234567890123456
|
/* 01234567890123456
|
||||||
* [HH:MM] message */
|
* [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);
|
gchar *date_fmt = g_date_time_format(last_time, time_pref);
|
||||||
assert(date_fmt != NULL);
|
assert(date_fmt != NULL);
|
||||||
size_t len = strlen(date_fmt);
|
size_t len = strlen(date_fmt);
|
||||||
|
g_free(date_fmt);
|
||||||
if (g_strcmp0(time_pref, "") != 0) {
|
if (g_strcmp0(time_pref, "") != 0) {
|
||||||
mvwprintw(status_bar, 0, 5 + len, message);
|
mvwprintw(status_bar, 0, 5 + len, message);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user