[common] Don't leak file descriptors when checking for colour schemes

Closes bug #606155.
This commit is contained in:
Jens Granseuer 2010-01-06 21:43:29 +01:00
parent 3d3ca6b7ea
commit 62d02072ef

View file

@ -212,17 +212,20 @@ gtkrc_get_color_scheme (const gchar *gtkrc_file)
{ {
if (GINT_TO_POINTER (token) == COLOR_SCHEME_SYMBOL) if (GINT_TO_POINTER (token) == COLOR_SCHEME_SYMBOL)
{ {
if (g_scanner_get_next_token (scanner) != '=') if (g_scanner_get_next_token (scanner) == '=')
continue; {
token = g_scanner_get_next_token (scanner); token = g_scanner_get_next_token (scanner);
if (token != G_TOKEN_STRING) if (token == G_TOKEN_STRING)
continue; {
g_free (result); g_free (result);
result = g_strdup (scanner->value.v_string); result = g_strdup (scanner->value.v_string);
} }
} }
} }
} }
close (file);
}
}
g_slist_foreach (read_files, (GFunc) g_free, NULL); g_slist_foreach (read_files, (GFunc) g_free, NULL);
g_slist_free (read_files); g_slist_free (read_files);