1) Argument message is completely redundant because it is NEVER used.
2) Allocating and returning a buffer like this is generally avoided, as I mentioned. Pass in a buffer and size and copy into the buffer.
3) Sizeof evaluates the size of a type, but won't work on a pointer because the size where it points to is unknown. Why? I'll let you think on that.
4) I suggest you read my linked article and think about the problem with freeing. The reason you're allocating on the heap is that it won't get freed until you explicitly choose to do so. You need to learn more about pointers.