Index: gail/gailitem.c
===================================================================
--- gail/gailitem.c	(revision 1234)
+++ gail/gailitem.c	(working copy)
@@ -287,10 +287,13 @@
                 }
               list = gtk_container_get_children (GTK_CONTAINER (parent));
               index = g_list_index (list, widget);
-              g_list_free (list);
 
               if (index < 0 || index > g_list_length (list))
-                return NULL;
+                {
+                  g_list_free (list);
+                  return NULL;
+                }
+              g_list_free (list);
 
               parent_obj = atk_object_get_parent (gtk_widget_get_accessible (parent));
               if (GTK_IS_ACCESSIBLE (parent_obj))
