--- gthumb-2.7.2/libgthumb/gth-file-list.c	2006-01-04 12:21:40.000000000 +0100
+++ gthumb/libgthumb/gth-file-list.c	2006-02-11 00:45:15.000000000 +0100
@@ -1007,11 +1007,13 @@
 	for (; scan; scan = scan->next) {
 		FileData *fd = scan->data;
 
-		if (strcmp (fd->path, path) == 0)
+		if (strcmp (fd->path, path) == 0) {
+			g_list_free(scan);
 			return i;
-
+		}
 		i++;
 	}
+	g_list_free(scan);
 
 	return -1;
 }
@@ -1048,6 +1050,7 @@
 		FileData *fd = scan->data;
 		list = g_list_prepend (list, g_strdup (fd->path));
 	}
+	g_list_free(scan);
 
 	return g_list_reverse (list);
 }
