I noticed that it is a common idiom in C to accept an un-malloced pointer as a second argument instead of returning a pointer. Example:
malloc
/*functi
personally I like to return data using refernce or pointer params, and use the function return for returning error codes.