g_free() to auto_gfree, introduce auto_guchar

Fix 11 potential mem leaks in theme.c
This commit is contained in:
John Hernandez
2023-07-13 17:04:59 +02:00
parent 3a4cd7da48
commit 8304ac86ff
39 changed files with 145 additions and 233 deletions

View File

@@ -214,13 +214,12 @@ log_msg(log_level_t level, const char* const area, const char* const msg)
char* level_str = _log_abbreviation_string_from_level(level);
gchar* date_fmt = g_date_time_format_iso8601(dt);
auto_gchar gchar* date_fmt = g_date_time_format_iso8601(dt);
fprintf(logp, "%s: %s: %s: %s\n", date_fmt, area, level_str, msg);
g_date_time_unref(dt);
fflush(logp);
g_free(date_fmt);
if (prefs_get_boolean(PREF_LOG_ROTATE) && !user_provided_log) {
long result = ftell(logp);