The life time of the pointer itself is not an issue unless you are returning a reference to it.
As K says the logical analysis of your code is that the returned memory pointed to by the pointer is owned by the caller so logically it is up to the caller to delete it, a design which I don't particularly care for due to it's unsymmetrical nature.
As K says the logical analysis of your code is that the returned memory pointed to by the pointer is owned by the caller so logically it is up to the caller to delete it, a design which I don't particularly care for due to it's unsymmetrical nature.