mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-22 18:36:21 +00:00
g_free() to auto_gfree, introduce auto_guchar
Fix 11 potential mem leaks in theme.c
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user