]> granicus.if.org Git - clang/commit
[analyzer] Make Malloc Checker track memory allocated by if_nameindex
authorAnna Zaks <ganna@apple.com>
Fri, 3 Oct 2014 21:48:59 +0000 (21:48 +0000)
committerAnna Zaks <ganna@apple.com>
Fri, 3 Oct 2014 21:48:59 +0000 (21:48 +0000)
commit5a9b42fd92e7e412c396cf2aa584484211fee8aa
tree5c2c31c258cb019d9b84c0b7c29efb88aced0c0d
parent6118a4aa50c887fd59fbc955aac1b53a3e3f4a46
[analyzer] Make Malloc Checker track memory allocated by if_nameindex

The MallocChecker does currently not track the memory allocated by
if_nameindex. That memory is dynamically allocated and should be freed
by calling if_freenameindex. The attached patch teaches the checker
about these functions.

Memory allocated by if_nameindex is treated as a separate allocation
"family". That way the checker can verify it is freed by the correct
function.

A patch by Daniel Fahlgren!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@219025 91177308-0d34-0410-b5e6-96231b3b80d8
lib/StaticAnalyzer/Checkers/MallocChecker.cpp