diff --git a/lib/cppcheck.cpp b/lib/cppcheck.cpp index a75cda011b9a..a0b669ff056c 100644 --- a/lib/cppcheck.cpp +++ b/lib/cppcheck.cpp @@ -1102,6 +1102,8 @@ void CppCheck::checkNormalTokens(const Tokenizer &tokenizer) mAnalyzerInformation.setFileInfo("ctu", fi1->toString()); if (mSettings.useSingleJob()) mFileInfo.push_back(fi1); + else + delete fi1; } // cppcheck-suppress shadowFunction - TODO: fix this @@ -1114,6 +1116,8 @@ void CppCheck::checkNormalTokens(const Tokenizer &tokenizer) mAnalyzerInformation.setFileInfo(check->name(), fi->toString()); if (mSettings.useSingleJob()) mFileInfo.push_back(fi); + else + delete fi; } } }