If your function is made to return an allocated buffer, there's no leak. Better, there's a leak if the client code on purpose calls your routine and does not do anything with what it returns, but in that case, it's the client code that is violating your contract.
When the buffer gets returned, it's controlled by the client code. In general, it's a good idea for solid programming to let allocation/deallocation happen at the same layer. Meaning that if you have a routine that returns a buffer, you should have a corresponding routine that deallocates it, even if the client code could call a delete[].
For example: suppose you have this code
char *mylib_gimmeh_buffer() {
char* returnMe = new char[24324];
return returnMe;
}
For symmetry you should have also
char *mylib_free_buffer(buffer) {
delete[] buffer;
}
Now, your client code should behave like this
buf = mylib_gimmeh_buffer();
/* do something with buf */
mylib_free_buffer(buf);
if your client does something like this
mylib_gimmeh_buffer(); // just for fun
or like this
buf = mylib_gimmeh_buffer();
/* do something with buf */
/* never call mylib_free_buffer() */
then there's a memory leak