Fix: libcrmcommon: Don't allocate a ptr array until it's needed.
This saves from having to just immediately free it (which wasn't being done, introducing a memory leak) if the input string was NULL.