I'm unsure about returning memory allocated by a local object within a function, such as malloc( ). I was thinking something along the lines of: If I allocate a block of resources with a local object within a function and return it, will that be safe?
Since MemBlock is local to NewBlock( ), once NewBlock( ) finishes, MemBlock is popped from the stack. So, where does the memory go? who's the owner of this memory?