Yes, but it seems like the buffer returns a const char* because it still owns the data, rather than returning a char *copy to give to the Rval. In general, what happens if somebody deletes the Rval later and tries to free the memory?