theme.c: Squash memory leak

When converting a token to a different type, we need to free its
string.

https://bugzilla.gnome.org/show_bug.cgi?id=649500
This commit is contained in:
Colin Walters 2011-05-05 16:46:00 -04:00
parent 6596374886
commit d0414a3ea6

View File

@ -2639,11 +2639,13 @@ meta_theme_replace_constants (MetaTheme *theme,
{
if (meta_theme_lookup_int_constant (theme, t->d.v.name, &ival))
{
g_free (t->d.v.name);
t->type = POS_TOKEN_INT;
t->d.i.val = ival;
}
else if (meta_theme_lookup_float_constant (theme, t->d.v.name, &dval))
{
g_free (t->d.v.name);
t->type = POS_TOKEN_DOUBLE;
t->d.d.val = dval;
}