Do not allocate redundant storage for identical strings.

I'd also be thrilled to simply release the allocated memory after the function call returns (or re-use a statically allocated portion of the heap), however that would break any existing code that retained copies of `char *` parameters instead of copying the addressed memory.