libc already includes reallocarray(3) so its use is auto-consistent.
Try to use reallocarray(3) when we are using realloc(3) and there is a
multiplication involved. Attempt to use the unsigned nature of the
parameters unless they are a copy of something that is signed.
While here attempt to improve the initialization on some cases-