[qfcc] Actually shrink the unaligned hole

This fixes the duplicate allocation caused by an exact fit aligned alloc
in an unaligned hole where the padding remains free.
This commit is contained in:
Bill Currie 2022-05-01 14:11:11 +09:00
parent 7518ba0a27
commit be4021f8f4

View file

@ -173,7 +173,8 @@ defspace_alloc_aligned_loc (defspace_t *space, int size, int alignment)
// exact fit, so just shrink the block or remove it if there is no
// padding (any padding remains free)
if (size + pad == loc->size) {
if (!pad) {
loc->size -= size;
if (!loc->size) {
*l = loc->next;
del_locref (loc);
}