css: Avoid a possible memory leak

Currently, style->variables is always NULL when we get here, but
better to be safe than sorry, and clear the fields before we
overwrite it.
This commit is contained in:
Matthias Clasen 2024-05-20 08:57:28 -04:00
parent a19d0471e9
commit 73f64971c8

View File

@ -865,6 +865,7 @@ gtk_css_lookup_resolve (GtkCssLookup *lookup,
}
else if (parent_style && parent_style->variables)
{
g_clear_pointer (&style->variables, gtk_css_variable_set_unref);
style->variables = gtk_css_variable_set_ref (parent_style->variables);
}