You code is OK, but I would not return a string like this.
The code calling the fn1 will have a requirement to delete[] the string array. This is often considered bad practice. There are better ways to return strings in C++.
You could:
1. Return a string object. This is best. I.e.
Code:
string fn1()
{
return "test";
}
2. If you want you're code to use char*, you could cause fn1 to copy the result into an existing buffer.
Code:
void fn1(char* s, int s_len)
{
strncpy(s, "test", s_len);
}
3. There are other ways also, including the one you suggested. But whether you should use them depends on the requirements of your project. I.e. if your code forms a DLL etc.