Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Why it is bad idea to check result of malloc call with assert (pvs-studio.com)
1 point by GodCreation on Feb 20, 2024 | hide | past | favorite | 1 comment


The pointer returned by malloc needs to be checked before use. Using the assert macro to check the pointer would be wrong. In this article, we'll investigate why this is a bad programming tip.




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

Search: