Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That's not a memory leak (when done at top level) because it's reachable for the entire execution of the program. Memory is only leaked if it's still allocated once it's no longer reachable.


Memcheck disagrees: https://developers.redhat.com/blog/2021/04/23/valgrind-memch...

Technically, this is still a memory leak, it's just considered less serious.




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: