[bugfix] don't melt base header into *backword* free chunk as well.

This commit is contained in:
Yuichi Nishiwaki 2015-07-16 17:11:55 +09:00
parent ebcf6d00fb
commit 6fdd5ef05d
1 changed files with 1 additions and 1 deletions

View File

@ -203,7 +203,7 @@ heap_free(pic_state *pic, void *ap)
} else { } else {
bp->s.ptr = p->s.ptr; bp->s.ptr = p->s.ptr;
} }
if (p + p->s.size == bp) { if (p + p->s.size == bp && bp->s.size > 0) { /* don't melt base header */
p->s.size += bp->s.size; p->s.size += bp->s.size;
p->s.ptr = bp->s.ptr; p->s.ptr = bp->s.ptr;
} else { } else {