diff --git a/src/object.c b/src/object.c
index 06d3b6d8ba27bd8466dcdb64d925db9e608eb932..0881b7dccd1e75690e58e6587d79f8798e9a54b6 100644
--- a/src/object.c
+++ b/src/object.c
@@ -5,7 +5,7 @@
 \*/
 /**/
 #include "global.h"
-RCSID("$Id: object.c,v 1.110 2000/04/15 07:45:52 hubbe Exp $");
+RCSID("$Id: object.c,v 1.111 2000/04/17 14:11:09 mast Exp $");
 #include "object.h"
 #include "dynamic_buffer.h"
 #include "interpret.h"
@@ -1237,9 +1237,8 @@ void gc_free_all_unreferenced_objects(void)
 
   Pike_in_gc=4;  /* Allow thread switches, god help us */
 
-  for(o=first_object;o;o=next)
+  for(o=first_object;o;o=o->next)
   {
-    next=o->next;
     if(gc_do_free(o))
     {
       add_ref(o);