fix ownership transfer for char_p return values