PacktPublishing / Extreme-C

Extreme C, published by Packt
MIT License
314 stars 129 forks source link

Does this fix a memory leak? #2

Open grahame-student opened 3 years ago

grahame-student commented 3 years ago

It looks like there could be a memory leak in this example. person_dtor() is not freeing the passed in pointer, therefore when student_dtor() calls the base class' destructor the allocated memory is never released.

If I've missed where there memory is freed I would love to know.

kamcpp commented 2 years ago

Hi, sorry for the late reply. I need to look at the example again. Your change seems to be correct and sane but I want to double check.