imcontextsimple: Plug a memory leak

This commit is contained in:
Matthias Clasen 2022-04-02 15:22:12 -04:00
parent b024c9a743
commit e2abb0211c

View File

@ -274,7 +274,6 @@ gtk_im_context_simple_init_compose_table (void)
char **lang = NULL;
const char * const sys_langs[] = { "el_gr", "fi_fi", "pt_br", NULL };
const char * const *sys_lang = NULL;
char *x11_compose_file_dir = get_x11_compose_file_dir ();
path = g_build_filename (g_get_user_config_dir (), "gtk-4.0", "Compose", NULL);
if (g_file_test (path, G_FILE_TEST_EXISTS))
@ -323,7 +322,9 @@ gtk_im_context_simple_init_compose_table (void)
{
if (g_ascii_strncasecmp (*lang, *sys_lang, strlen (*sys_lang)) == 0)
{
char *x11_compose_file_dir = get_x11_compose_file_dir ();
path = g_build_filename (x11_compose_file_dir, *lang, "Compose", NULL);
g_free (x11_compose_file_dir);
break;
}
}
@ -336,7 +337,6 @@ gtk_im_context_simple_init_compose_table (void)
g_clear_pointer (&path, g_free);
}
g_free (x11_compose_file_dir);
g_strfreev (langs);
if (path != NULL &&