2 ms·
True. I wasn't able to find a good source on how common memory leaks are in modern C code. Do you have one? I'd be surprised if memory leaks are far less commo
by MaxBarraclough 6y ago
True. I wasn't able to find a good source on how common memory leaks are in modern C code. Do you have one?
I'd be surprised if memory leaks are far less common than double-free, use-after-free, dereferencing NULL, and out-of-bounds access. I'd expect they'd be roughly equally difficult to detect, either manually or using tooling like Valgrind and static-analysers. I'd also expect memory-leaks to be of generally less concern, and therefore less 'newsworthy', as a small memory leak isn't as likely to pose a real problem as any of the other errors.
- ncmncm 6y agoYes, double-free and use-after-free are no end of trouble in C programs (and, incidentally, vanishingly rare in C++ programs), but this thread is specifically about leaks in C and in GC languages (and which are also vanishingly rare in C++ programs).