Because the following loop overflows: while (size > new_allocated) new_allocated += (new_allocated >> 1) + 32;