Returns a pointer to a copy of the input string. The allocated buffer returned should be deallocated using FreeStringA function or any other free functions defined in chsvmem.h. On failure the function returns NULL setting corresponding chsvlib error code.