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)
This commit is contained in:
Eli Zaretskii 2017-10-31 21:08:35 +02:00
parent 3e7ebbe1bd
commit 41adf3281e

View file

@ -7024,7 +7024,9 @@ sweep_symbols (void)
{ {
if (!sym->s.gcmarkbit) 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)); xfree (SYMBOL_BLV (&sym->s));
sym->s.next = symbol_free_list; sym->s.next = symbol_free_list;
symbol_free_list = &sym->s; symbol_free_list = &sym->s;