[cfe-dev] static analysis inlining varargs functions
Bob Kuo
Bob.Kuo at riverbed.com
Tue Mar 17 13:21:21 PDT 2015
Hello clang developers,
We recently found a memory leak at work we were not freeing allocated memory returned by the standard C string strdup() function. I ran the static analyzer against a version of the code with the defect and it didn't detect a memory leak. When I reduced the code to a simpler test case the static analyzer correctly identified the leak. After a few iterations I found that the culprit was a varargs function where the variable that held a reference to the allocated memory was a parameter. With the call to the varargs function commented out, the static analyzer identified the leak. With the call to the varargs function no warning was produced.
Is this a design decision or inherent limit in the static analyzer? Is this a known issue? I didn't see any bugs in the tracker. Should I file a bug?
Thanks,
Bob Kuo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150317/f5e8d296/attachment.html>
More information about the cfe-dev
mailing list