if (laligned (p, size) && (MALLOC_0_IS_NONNULL || size || p))
return p;
free (p);
- size_t bigger = size + LISP_ALIGNMENT;
- if (size < bigger)
+ size_t bigger;
+ if (!ckd_add (&bigger, size, LISP_ALIGNMENT))
size = bigger;
}
}
p = realloc (p, size);
if (laligned (p, size) && (size || p))
return p;
- size_t bigger = size + LISP_ALIGNMENT;
- if (size < bigger)
+ size_t bigger;
+ if (!ckd_add (&bigger, size, LISP_ALIGNMENT))
size = bigger;
}
}