The returned pointer shouldn't be passed to a function expecting a null terminated C string. Use the StringRef::copy function instead which is more efficient anyway since it doesn't have to measure the size of the string again.
The returned pointer shouldn't be passed to a function expecting a null terminated C string. Use the StringRef::copy function instead which is more efficient anyway since it doesn't have to measure the size of the string again.