Unsafe double reallocate pattern
A lot of code uses a pattern where it doubles the allocation size if an array is full. However, this is prone to integer overflow and might be insecure. This code should migrate to safer coding patterns or use overflow checking and reallocarray.