Index: trunk/src/dnmalloc.c
===================================================================
--- trunk/src/dnmalloc.c	(revision 227)
+++ trunk/src/dnmalloc.c	(revision 228)
@@ -92,5 +92,5 @@
    Fail    on: OpenBSD/pthread (in  _thread_machdep_save_float_state),
                might be related to OpenBSD pthread internals (??).
-	       Non-treaded version (#undef USE_MALLOC_LOC) 
+	       Non-treaded version (#undef USE_MALLOC_LOCK) 
 	       works on OpenBSD.
    
@@ -101,4 +101,5 @@
    Minor cleanups
    Fix: eliminate prototypes for memset, memcpy (they're in string.h)
+   Fix: one more malloc_consolidate segfault
 
    There may be some bugs left in this version. please use with caution.
@@ -4406,9 +4407,15 @@
 	  /* consolidate forward */
 	  if (!inuse(nextchunk)) {
-	    unlink(nextchunk, bck, fwd);
-	    size += nextsize;
-	    set_head(p, size | PREV_INUSE);
-	    hashtable_skiprm(p, nextchunk);
-	    freecilst_add (nextchunk);
+	    /* if mmap is used instead of sbrk, we may have a
+	     * chunk with !nextchunk->fd && !nextchunk->bk
+	     */
+	    if (nextchunk->fd && nextchunk->fd)
+	      {
+		unlink(nextchunk, bck, fwd);
+		size += nextsize;
+		set_head(p, size | PREV_INUSE);
+		hashtable_skiprm(p, nextchunk);
+		freecilst_add (nextchunk);
+	      }
 	  }
 	  
