Fixed the memory leak. I was passing a pointer instead of a reference to a pointer's address. So, i was not assigning the newly malloc'd memory location to my patient pointer.