preserve input pointer in realloc for copy/deallocate use