mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-20 20:56:21 +00:00
g_free() to auto_gfree, introduce auto_guchar
Fix 11 potential mem leaks in theme.c
This commit is contained in:
@@ -525,9 +525,8 @@ c_api_init(void)
|
||||
static char*
|
||||
_c_plugin_name(const char* filename)
|
||||
{
|
||||
gchar* name = g_strndup(filename, strlen(filename) - 1);
|
||||
auto_gchar gchar* name = g_strndup(filename, strlen(filename) - 1);
|
||||
gchar* result = g_strdup_printf("%sso", name);
|
||||
g_free(name);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ theme_item_t
|
||||
plugin_themes_get(const char* const group, const char* const key, const char* const def)
|
||||
{
|
||||
if (group && key && g_key_file_has_key(themes, group, key, NULL)) {
|
||||
gchar* result = g_key_file_get_string(themes, group, key, NULL);
|
||||
auto_gchar gchar* result = g_key_file_get_string(themes, group, key, NULL);
|
||||
|
||||
theme_item_t ret;
|
||||
|
||||
@@ -148,8 +148,6 @@ plugin_themes_get(const char* const group, const char* const key, const char* co
|
||||
else
|
||||
ret = THEME_TEXT;
|
||||
|
||||
g_free(result);
|
||||
|
||||
return ret;
|
||||
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user