Index: libguile/gc-malloc.c =================================================================== RCS file: /cvsroot/guile/guile/guile-core/libguile/gc-malloc.c,v retrieving revision 1.28.2.2 diff -u -r1.28.2.2 gc-malloc.c --- libguile/gc-malloc.c 15 Feb 2006 00:38:44 -0000 1.28.2.2 +++ libguile/gc-malloc.c 5 Feb 2008 23:34:06 -0000 @@ -317,7 +317,7 @@ to write it the program is killed with signal 11. --hwn */ - void *ptr = scm_malloc (size); + void *ptr = size ? scm_malloc (size) : NULL; scm_gc_register_collectable_memory (ptr, size, what); return ptr; } @@ -363,7 +363,8 @@ scm_gc_free (void *mem, size_t size, const char *what) { scm_gc_unregister_collectable_memory (mem, size, what); - free (mem); + if (mem) + free (mem); } char *