diff --git a/.gitattributes b/.gitattributes
index 5fe7a63fa3ef85cd155de4e06afe9ca5b60f2ae9..9f740f62697f46adb3e9f2743d5cac5ee9324f08 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -402,7 +402,6 @@ testfont binary
 /src/mapping.c foreign_ident
 /src/mapping.h foreign_ident
 /src/mklibpike.pike foreign_ident
-/src/module.c foreign_ident
 /src/module.h foreign_ident
 /src/module_magic.h foreign_ident
 /src/module_support.c foreign_ident
diff --git a/src/module.c b/src/module.c
index 52c9ba3ae690c642612ad409b0f1bfea2cc86431..432e0d9505cbc98da230025efaa83ac86c0b20cd 100644
--- a/src/module.c
+++ b/src/module.c
@@ -2,7 +2,7 @@
 || This file is part of Pike. For copyright information see COPYRIGHT.
 || Pike is distributed under GPL, LGPL and MPL. See the file COPYING
 || for more information.
-|| $Id: module.c,v 1.59 2008/11/02 19:57:58 grubba Exp $
+|| $Id$
 */
 
 #include "global.h"
@@ -153,7 +153,6 @@ static void exit_builtin_modules(void)
    * THREADS_ALLOW/DISALLOW are NOPs beyond this point. */
   th_cleanup();
 #endif
-  free_all_pike_list_node_blocks();
 
   exit_pike_security();
   free_svalue(& throw_value);
@@ -355,6 +354,7 @@ static void exit_builtin_modules(void)
   cleanup_pike_type_table();
   cleanup_shared_string_table();
 
+  free_all_pike_list_node_blocks();
   free_dynamic_load();
   first_mapping=0;
   free_all_mapping_blocks();