malloc in main() or malloc in another function: allocating memory for a struct and its members
Looking at the performance, the two versions should perform just about identically.  The second version has one less call/return, which can save a couple of CPU cycles, but if you have it multiple places in your code the additional code bytes and cache misses can overshadow that.  Either way you probably won't notice a difference.

Looking at readability and maintainability, the first version is much better.  You know at a glance what it is doing (rather than looking at several lines to figure it all out), you won't forget any important steps, and error checking is much easier since most of it can be handled in one place (excepting the last check for successful creation of the buffer).  Debugging can also be easier, since you can set a breakpoint on the creation or destruction functions if necessary.