]> granicus.if.org Git - clang/commit
Fix a Malloc Checker FP by tracking return values from initWithCharacter
authorAnna Zaks <ganna@apple.com>
Tue, 13 Nov 2012 03:18:01 +0000 (03:18 +0000)
committerAnna Zaks <ganna@apple.com>
Tue, 13 Nov 2012 03:18:01 +0000 (03:18 +0000)
commit4141e4dcab6b175374710925aa90d547600a5e66
tree99666fe2c69354c0d1995ce62f7985c2c583511e
parent30305bec25cac981c6d4a3b8be004401310a82a7
Fix a Malloc Checker FP by tracking return values from initWithCharacter
and other functions.

When these functions return null, the pointer is not freed by
them/ownership is not transfered. So we should allow the user to free
the pointer by calling another function when the return value is NULL.

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