animator: avoid walking off empty list

When removing the last key in a list, the last part of the for statement
could cause dereferencing (NULL)->next and thus segfaulting.
This commit is contained in:
Øyvind Kolås 2010-06-16 17:43:44 +01:00
parent 698cce8276
commit 35c6179a8e

View File

@ -1407,7 +1407,7 @@ clutter_animator_remove_key_internal (ClutterAnimator *animator,
priv = animator->priv;
for (k = priv->score; k != NULL; k = k->next)
for (k = priv->score; k != NULL; k = k?k->next:NULL)
{
ClutterAnimatorKey *key = k->data;