cogl: Do not unref a NULL object

Add return-if-fail statement to avoid deferencing NULL object


(cherry picked from commit 3104d697c0)
This commit is contained in:
Marco Trevisan (Treviño) 2018-04-19 04:49:01 -05:00 committed by Marco Trevisan
parent 1b439c42d1
commit 7076a48bcf

View File

@ -109,7 +109,11 @@ _cogl_object_default_unref (void *object)
void
cogl_object_unref (void *obj)
{
void (* unref_func) (void *) = ((CoglObject *) obj)->klass->virt_unref;
void (* unref_func) (void *);
_COGL_RETURN_IF_FAIL (obj != NULL);
unref_func = ((CoglObject *) obj)->klass->virt_unref;
unref_func (obj);
}