3 ms·
And then you accidently add a use-after-free bug by trying to satisfy a "correctness" tool...
by matja 2y ago
And then you accidently add a use-after-free bug by trying to satisfy a "correctness" tool...
- SubjectToChange 2y agoIt’s hard to fault the static analysis tooling here. Not freeing memory is, almost always, unintended behavior. Besides, if a business is going to blindly apply static analysis to their projects and then demand that every warning be “fixed”, then the tool really isn’t the problem. Still, any serious developer should, at the very least, have the patience to interrogate their code.
- nkrisc 2y agoThe tool doesn’t demand it be satisfied, a manager does.
- jmb99 2y agoCoverity will definitely warn you about use-after-free. It’s not a “correctness” tool, it’s a static analyzer and probably the best one out there (imo). Yes in this use case it’s probably not too important to care about, but really any code base of importance should be run through it on a fairly regular basis.