From 68db37aa53b01c2c7b62ea3b86c4e4ce467a6c9e Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Tue, 30 Nov 2004 00:31:09 +0000 Subject: [PATCH] (malloc_initialize_hook): Don't free malloc_state_ptr if XMALLOC_OVERRUN_CHECK to avoid crash during load. --- src/emacs.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/emacs.c b/src/emacs.c index a6d3356847e..907d7295fc7 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -584,7 +584,7 @@ init_cmdargs (argc, argv, skip_args) They are decoded in the function command-line after we know locale-coding-system. */ Vcommand_line_args - = Fcons (make_unibyte_string (argv[i], strlen (argv[i])), + = Fcons (make_unibyte_string (argv[i], strlen (argv[i])), Vcommand_line_args); } @@ -748,7 +748,9 @@ malloc_initialize_hook () } malloc_set_state (malloc_state_ptr); +#ifndef XMALLOC_OVERRUN_CHECK free (malloc_state_ptr); +#endif } else { @@ -1984,9 +1986,9 @@ sort_args (argc, argv) bcopy (new, argv, sizeof (char *) * argc); - free (options); - free (new); - free (priority); + xfree (options); + xfree (new); + xfree (priority); } DEFUN ("kill-emacs", Fkill_emacs, Skill_emacs, 0, 1, "P", -- 2.39.5