[common] Don't leak file descriptors when checking for colour schemes
Closes bug #606155.
This commit is contained in:
parent
3d3ca6b7ea
commit
62d02072ef
1 changed files with 10 additions and 7 deletions
|
@ -212,17 +212,20 @@ gtkrc_get_color_scheme (const gchar *gtkrc_file)
|
|||
{
|
||||
if (GINT_TO_POINTER (token) == COLOR_SCHEME_SYMBOL)
|
||||
{
|
||||
if (g_scanner_get_next_token (scanner) != '=')
|
||||
continue;
|
||||
if (g_scanner_get_next_token (scanner) == '=')
|
||||
{
|
||||
token = g_scanner_get_next_token (scanner);
|
||||
if (token != G_TOKEN_STRING)
|
||||
continue;
|
||||
if (token == G_TOKEN_STRING)
|
||||
{
|
||||
g_free (result);
|
||||
result = g_strdup (scanner->value.v_string);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
close (file);
|
||||
}
|
||||
}
|
||||
|
||||
g_slist_foreach (read_files, (GFunc) g_free, NULL);
|
||||
g_slist_free (read_files);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue