Introduce reallocarr(3) for easy (re)allocation of memory with overflow checks. Compared to OpenBSD's reallocarray, makes it easier to avoid memory leaks on allocation failures and it doesn't depend
Introduce reallocarr(3) for easy (re)allocation of memory with overflow checks. Compared to OpenBSD's reallocarray, makes it easier to avoid memory leaks on allocation failures and it doesn't depend on malloc(0) != NULL for correct error checking. Compared to plain realloc, it also avoids the problem of intermediate integer overflows. The trade-off is the use of void * to side step C type system with regard to generic pointer to pointer.
show more ...
|