]> git.eshelyaron.com Git - emacs.git/commitdiff
Avoid duplicate calls to xfree for the same pointer
authorEli Zaretskii <eliz@gnu.org>
Tue, 31 Oct 2017 19:08:35 +0000 (21:08 +0200)
committerEli Zaretskii <eliz@gnu.org>
Tue, 31 Oct 2017 19:08:35 +0000 (21:08 +0200)
* src/alloc.c (sweep_symbols): Avoid freeing an already freed
pointer to a symbol's buffer-local value.  (Bug#29066)

src/alloc.c

index d9d74856799b3fe87ee2a31187141914b5244699..11afdfd7cc064e09b66b68ad8c04f5f6eca7b93b 100644 (file)
@@ -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;