logoalt Hacker News

Arch-TKyesterday at 12:38 PM1 replyview on HN

If you have something which contains pointers, you should have a destructor function for it, which itself should check if the pointer is not NULL before attempting to free any fields.


Replies

t43562yesterday at 1:39 PM

That's certainly one way to do it if you're writing all the code.