From 4753b6342138eab39258ea651cc54a3dd10d51ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Grubbstr=C3=B6m=20=28Grubba=29?= <grubba@grubba.org> Date: Fri, 15 Nov 2019 15:58:17 +0100 Subject: [PATCH] Cleanup [ADT.List]: Do not free memory that is in use before gc(1) has run. The nodes used by ADT.List were freed before the cleanup call of gc(1). This could cause the gc to follow links into freed and/or reused memory. Fixes [PIKE-227]. --- .gitattributes | 1 - src/module.c | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.gitattributes b/.gitattributes index 5fe7a63fa3..9f740f6269 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 52c9ba3ae6..432e0d9505 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(); -- GitLab