You're passing the pointer by value. Assignments to the pointer inside the function won't be visible to the calling function. You can try using a reference to a pointer (char *&) instead.
This, or using a pointer to pointer has the same result: void function(Foo** foo) then to assign something new: *foo/(*foo) = <VALUE>