By using *s all over the place instead of just assigning the final result to it, you make your code unreadable, error prone, and inefficient.
What's worse is returning a separate error indicator, with a function name that makes it absolutely not clear how that error indicator is to be interpreted. Instead of the obvious way to return the pointer. What's good for malloc is good for me.