return notNullState;
SymbolRef Sym = SR->getSymbol();
-
const RefState *RS = state->get<RegionState>(Sym);
// If the symbol has not been tracked, return. This is possible when free() is
// Check double free.
if (RS->isReleased()) {
- ExplodedNode *N = C.GenerateSink();
- if (N) {
+ if (ExplodedNode *N = C.GenerateSink()) {
if (!BT_DoubleFree)
BT_DoubleFree
= new BuiltinBug("Double free",
void MallocChecker::ReportBadFree(CheckerContext &C, SVal ArgVal,
SourceRange range) {
- ExplodedNode *N = C.GenerateSink();
- if (N) {
+ if (ExplodedNode *N = C.GenerateSink()) {
if (!BT_BadFree)
BT_BadFree = new BuiltinBug("Bad free");
return;
if (RS->isAllocated()) {
- ExplodedNode *N = C.GenerateSink();
- if (N) {
+ if (ExplodedNode *N = C.GenerateSink()) {
if (!BT_Leak)
BT_Leak = new BuiltinBug("Memory leak",
"Allocated memory never released. Potential memory leak.");