Index: gail/gailitem.c
===================================================================
--- gail/gailitem.c	(revisjon 1237)
+++ gail/gailitem.c	(arbeidskopi)
@@ -287,10 +287,11 @@ gail_item_get_name (AtkObject *obj)
                 }
               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))
+              if (index < 0 || index > g_list_length (list)) {
+        	g_list_free (list);
                 return NULL;
+              }
 
               parent_obj = atk_object_get_parent (gtk_widget_get_accessible (parent));
               if (GTK_IS_ACCESSIBLE (parent_obj))
@@ -325,6 +326,7 @@ gail_item_get_name (AtkObject *obj)
                     }
                 }
             }
+    	  g_list_free (list);
         }
     }
   return name;
