From 41adf3281ef6386c539f1fb9d36c4fb3f643b77c Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Tue, 31 Oct 2017 21:08:35 +0200 Subject: [PATCH] Avoid duplicate calls to xfree for the same pointer * src/alloc.c (sweep_symbols): Avoid freeing an already freed pointer to a symbol's buffer-local value. (Bug#29066) --- src/alloc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/alloc.c b/src/alloc.c index d9d74856799..11afdfd7cc0 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -7024,7 +7024,9 @@ sweep_symbols (void) { if (!sym->s.gcmarkbit) { - if (sym->s.redirect == SYMBOL_LOCALIZED) + if (sym->s.redirect == SYMBOL_LOCALIZED + /* Already freed? */ + && !EQ (sym->s.function, Vdead)) xfree (SYMBOL_BLV (&sym->s)); sym->s.next = symbol_free_list; symbol_free_list = &sym->s; -- 2.39.2