aboutsummaryrefslogtreecommitdiffstats
path: root/src/alloc.c
diff options
context:
space:
mode:
authorGerd Moellmann2000-10-23 15:03:55 +0000
committerGerd Moellmann2000-10-23 15:03:55 +0000
commita83fee2c5629b8c4c73f18043df72d2a4edd5ccd (patch)
tree9e879f8b88908e4a70c4eca7a6cc5ecfed26469d /src/alloc.c
parent182334bd081466ba449a71cbc831affd810ac4cd (diff)
downloademacs-a83fee2c5629b8c4c73f18043df72d2a4edd5ccd.tar.gz
emacs-a83fee2c5629b8c4c73f18043df72d2a4edd5ccd.zip
(emacs_blocked_free) [GC_MALLOC_CHECK]: Handle freeing
null.
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/src/alloc.c b/src/alloc.c
index 54c4b447fde..625dc14720f 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -655,22 +655,23 @@ emacs_blocked_free (ptr)
655 BLOCK_INPUT; 655 BLOCK_INPUT;
656 656
657#ifdef GC_MALLOC_CHECK 657#ifdef GC_MALLOC_CHECK
658 { 658 if (ptr)
659 struct mem_node *m; 659 {
660 struct mem_node *m;
660 661
661 m = mem_find (ptr); 662 m = mem_find (ptr);
662 if (m == MEM_NIL || m->start != ptr) 663 if (m == MEM_NIL || m->start != ptr)
663 { 664 {
664 fprintf (stderr, 665 fprintf (stderr,
665 "Freeing `%p' which wasn't allocated with malloc\n", ptr); 666 "Freeing `%p' which wasn't allocated with malloc\n", ptr);
666 abort (); 667 abort ();
667 } 668 }
668 else 669 else
669 { 670 {
670 /* fprintf (stderr, "free %p...%p (%p)\n", m->start, m->end, ptr); */ 671 /* fprintf (stderr, "free %p...%p (%p)\n", m->start, m->end, ptr); */
671 mem_delete (m); 672 mem_delete (m);
672 } 673 }
673 } 674 }
674#endif /* GC_MALLOC_CHECK */ 675#endif /* GC_MALLOC_CHECK */
675 676
676 __free_hook = old_free_hook; 677 __free_hook = old_free_hook;