May need to discuss what you think is best approach for this as the xmalloc and xrealloc already there use ssize_t.

The libsrs2 expects size_t and I did not want to mix signed/unsigned. The initial problem was it seemed hat libsrs2 internally uses malloc/realloc by default and does not check returns, so potentially crash under low memory.