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

@@ -303,11 +303,10 @@ get_start(const char* const string, int tokens)
gunichar curr_uni = g_utf8_get_char(curr_ch);
if (num_tokens < tokens) {
gchar* uni_char = g_malloc(7);
auto_gchar gchar* uni_char = g_malloc(7);
int len = g_unichar_to_utf8(curr_uni, uni_char);
uni_char[len] = '\0';
g_string_append(result, uni_char);
g_free(uni_char);
}
if (curr_uni == ' ') {
if (!in_quotes) {