gparamspecs: Fix type class leaks on error handling paths

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Helps: #1911
This commit is contained in:
Philip Withnall 2019-10-28 14:57:33 +00:00
parent 1bebba0430
commit 1a3bba4670

View File

@ -2092,7 +2092,10 @@ g_param_spec_enum (const gchar *name,
blurb,
flags);
if (espec == NULL)
return NULL;
{
g_type_class_unref (enum_class);
return NULL;
}
espec->enum_class = enum_class;
espec->default_value = default_value;
@ -2140,7 +2143,10 @@ g_param_spec_flags (const gchar *name,
blurb,
flags);
if (fspec == NULL)
return NULL;
{
g_type_class_unref (flags_class);
return NULL;
}
fspec->flags_class = flags_class;
fspec->default_value = default_value;