5 ms·
Ask HN: How to avoid memory leaks in C?
- TheChaplain 8y agoWrite code that is easy to maintain/read, make sure you understand the API:s and free allocated resources. Also learn how to use Valgrind, it is a remarkable tool really.
- flukus 8y ago> Also learn how to use Valgrind, it is a remarkable tool really Seconded. Valgrind + unit tests + an incremental build can give you some really fast feedback on memory leaks and other issues. Just yesterday it showed us some errors in some "memory safe" c++ corner cases too.
- blacksqr 8y ago"Writing Bug-free C Code" https://www.duckware.com/bugfreec/index.html https://www.duckware.com/bugfreec/index.html