cppcheck/lib
Rikard Falkeborn f018163551
Improve handling of realloc in memory leak checker ()
Mark realloced variables as realloced instead of freed. This allows
improved checking for code with error realloc handling.

If cppcheck finds an if-statement which checks the validity of the
allocated memory or resource, check if the memory/resource is
reallocated from another variable. If so, we can add checking of that
variable in the if-statement instead. This allows to check that variable
for memleaks and double frees.

This fixes  and  which both concern FPs with double frees
after correct error handling.
2021-01-11 07:55:05 +01:00
..
CMakeLists.txt lib: Add condition for include externals/tinyxml2 () 2020-11-27 09:57:12 +01:00
analyzer.h astyle formatting 2020-11-11 09:17:54 +01:00
analyzerinfo.cpp Tweaks to use summaries in GUI 2020-12-19 20:46:00 +01:00
analyzerinfo.h Tweaks to use summaries in GUI 2020-12-19 20:46:00 +01:00
astutils.cpp Astyle: sync windows and linux folders () 2021-01-06 17:13:44 +01:00
astutils.h Replace and fix findBreakScope with findNextTokenFromBreak 2020-12-25 08:43:14 +01:00
bughuntingchecks.cpp library: Refactor to use enum class () 2021-01-08 10:29:01 +01:00
bughuntingchecks.h Add 'bughuntingchecks' 2020-06-19 13:16:48 +02:00
check.cpp daca: update WRONG_DATA interface 2020-10-03 15:36:02 +02:00
check.h daca: update WRONG_DATA interface 2020-10-03 15:36:02 +02:00
check64bit.cpp Update copyright year 2020-06-13 16:37:12 +02:00
check64bit.h Disable all simplified checks 2019-03-16 09:17:50 +01:00
checkassert.cpp Fix crash in cbmc detected with daca@home 2020-09-24 20:48:26 +02:00
checkassert.h added missing OVERRIDE usage and removed redundant virtual () 2019-09-20 21:57:16 +02:00
checkautovariables.cpp Fixed (False positive: autoVariable pointer is NULLed later) 2020-09-28 22:48:57 +02:00
checkautovariables.h Fixed (False positive: autoVariable pointer is NULLed later) 2020-09-28 22:48:57 +02:00
checkbool.cpp Refactoring; Added findBreakScope and Scope::isLoopScope() 2020-12-24 22:58:31 +01:00
checkbool.h Update Copyright year 2020-10-03 09:15:56 +02:00
checkboost.cpp Update copyright year 2020-06-13 16:37:12 +02:00
checkboost.h Disable all simplified checks 2019-03-16 09:17:50 +01:00
checkbufferoverrun.cpp astyle formatting 2021-01-10 14:46:19 +01:00
checkbufferoverrun.h some self-check suppression cleanups () 2021-01-09 20:32:38 +01:00
checkclass.cpp some self-check suppression cleanups () 2021-01-09 20:32:38 +01:00
checkclass.h Checking in fix for issue 9957 - - False negative: duplInheritedMember () 2020-12-21 07:14:52 +01:00
checkcondition.cpp Fix issue 8871: improve check: mismatching container size conditions () 2021-01-10 13:30:00 +01:00
checkcondition.h Removed integerOverflowOptimization checking and merged functionality into invalidTestForOverflow 2021-01-05 11:38:19 +01:00
checkexceptionsafety.cpp Update Copyright year 2020-10-03 09:15:56 +02:00
checkexceptionsafety.h made check.h less heavy () 2020-05-23 07:16:49 +02:00
checkfunctions.cpp Fix CodeQL warning, Multiplication result converted to larger type 2020-11-06 19:50:05 +01:00
checkfunctions.h library: Add new warning: ignoredReturnErrorCode () 2020-11-05 13:35:52 +01:00
checkinternal.cpp fixed some modernize-loop-convert clang-tidy warnings () 2020-09-21 19:30:47 +02:00
checkinternal.h Update copyright year 2020-05-10 11:16:32 +02:00
checkio.cpp fixed some modernize-loop-convert clang-tidy warnings () 2020-09-21 19:30:47 +02:00
checkio.h Update copyright year 2020-06-13 16:37:12 +02:00
checkleakautovar.cpp Improve handling of realloc in memory leak checker () 2021-01-11 07:55:05 +01:00
checkleakautovar.h Improve handling of realloc in memory leak checker () 2021-01-11 07:55:05 +01:00
checkmemoryleak.cpp Fix (FN common realloc mistake with assignment of NULL) 2020-09-13 21:49:49 +02:00
checkmemoryleak.h made check.h less heavy () 2020-05-23 07:16:49 +02:00
checknullpointer.cpp astyle formatting 2021-01-10 14:46:19 +01:00
checknullpointer.h Update copyright year 2020-06-13 16:37:12 +02:00
checkother.cpp fixed and enabled some more clang-tidy warnings () 2021-01-05 17:51:32 +01:00
checkother.h More fixing for . New warning id and warning message when variable expression is explicitly hidden. 2020-09-26 13:49:47 +02:00
checkpostfixoperator.cpp Update copyright year 2020-06-13 16:37:12 +02:00
checkpostfixoperator.h Disable all simplified checks 2019-03-16 09:17:50 +01:00
checksizeof.cpp remove cleanupAfterSimplify from the template simplifier () 2020-12-31 09:33:23 +01:00
checksizeof.h Disable all simplified checks 2019-03-16 09:17:50 +01:00
checkstl.cpp Code formatting [ci skip] 2021-01-04 13:09:05 +01:00
checkstl.h Improve check: check for known empty containers passed to algorithms () 2020-09-02 07:11:23 +02:00
checkstring.cpp Refactor: Use visitAstNodes in checkstring 2020-07-20 10:25:00 +02:00
checkstring.h Checkstring fixes () 2019-04-06 06:54:38 +02:00
checktype.cpp Removed integerOverflowOptimization checking and merged functionality into invalidTestForOverflow 2021-01-05 11:38:19 +01:00
checktype.h Removed integerOverflowOptimization checking and merged functionality into invalidTestForOverflow 2021-01-05 11:38:19 +01:00
checkuninitvar.cpp astyle formatting 2021-01-10 14:46:19 +01:00
checkuninitvar.h made check.h less heavy () 2020-05-23 07:16:49 +02:00
checkunusedfunctions.cpp Fix (False positive; Unused function (template)) () 2020-11-01 15:10:02 +01:00
checkunusedfunctions.h Silence unused variable warning () 2019-09-27 08:19:45 +02:00
checkunusedvar.cpp some self-check suppression cleanups () 2021-01-09 20:32:38 +01:00
checkunusedvar.h astyle formatting 2020-11-28 05:52:35 +01:00
checkvaarg.cpp Replace and fix findBreakScope with findNextTokenFromBreak 2020-12-25 08:43:14 +01:00
checkvaarg.h added missing OVERRIDE usage and removed redundant virtual () 2019-09-20 21:57:16 +02:00
clangimport.cpp ClangImport: If typeIndex is negative we want to have Cppcheck warnings about that 2021-01-10 14:51:28 +01:00
clangimport.h Clang import; Rename files/namespace 2020-01-10 16:29:06 +01:00
config.h Replace noreturn with macro 2020-06-29 15:54:51 -05:00
cppcheck.cpp fixed and enabled several clang-tidy warnings () 2021-01-02 19:10:25 +01:00
cppcheck.h Refactoring; Avoid 'unsigned' 2020-12-27 21:05:31 +01:00
cppcheck.natvis Fixed Visual Studio Natvis file after recent refactoring () 2018-07-09 08:27:26 +02:00
cppcheck.vcxproj Set language compatibility to C++14 in Visual Studio () 2020-12-22 10:24:25 +01:00
cppcheck.vcxproj.filters Visual Studio; Try to fix compilation 2020-12-20 21:01:45 +01:00
ctu.cpp some self-check suppression cleanups () 2021-01-09 20:32:38 +01:00
ctu.h some self-check suppression cleanups () 2021-01-09 20:32:38 +01:00
errorlogger.cpp Fix output when note contains 2020-09-25 19:04:22 +02:00
errorlogger.h Rename 'cppcheckID' to 'hash' 2020-07-21 11:27:03 +02:00
errortypes.cpp astyle formatting 2020-05-23 07:30:22 +02:00
errortypes.h made check.h less heavy () 2020-05-23 07:16:49 +02:00
exprengine.cpp some self-check suppression cleanups () 2021-01-09 20:32:38 +01:00
exprengine.h ExprEngine: Add condition branches for the while loops () 2020-12-22 20:21:57 +01:00
forwardanalyzer.cpp Astyle: sync windows and linux folders () 2021-01-06 17:13:44 +01:00
forwardanalyzer.h astyle formatting 2020-11-11 09:17:54 +01:00
importproject.cpp ImportProject: Fixed compile_commands.json problems 2020-12-25 14:47:01 +01:00
importproject.h ImportProject: Try to handle -D and -I in the same way 2020-12-25 11:51:24 +01:00
lib.pri Summaries: Moved to its own files 2020-12-20 19:53:58 +01:00
library.cpp library: Refactor to use enum class () 2021-01-08 10:29:01 +01:00
library.h library: Refactor to use enum class () 2021-01-08 10:29:01 +01:00
matchcompiler.h
mathlib.cpp Fix issue 8871: improve check: mismatching container size conditions () 2021-01-10 13:30:00 +01:00
mathlib.h Fix issue 8871: improve check: mismatching container size conditions () 2021-01-10 13:30:00 +01:00
path.cpp Various clang-tidy fixes () 2019-09-25 15:25:19 +02:00
path.h fixed and enabled -Wdocumentation and -Wdocumentation-pedantic clang warnings () 2020-12-27 09:15:59 +01:00
pathanalysis.cpp Refactorization: Moved code from header to source 2020-05-19 08:35:12 +02:00
pathanalysis.h made check.h less heavy () 2020-05-23 07:16:49 +02:00
pathmatch.cpp Update Copyright year 2020-10-03 09:15:56 +02:00
pathmatch.h Updated copyright year 2018-10-13 18:20:31 +02:00
pcrerules.pri
platform.cpp use range loops / constness () 2019-09-19 20:29:33 +02:00
platform.h Update copyright year 2020-05-10 11:16:32 +02:00
precompiled.h Visual Studio: Use new files precompiled.h with several common includes for core and testrunner. 2020-05-29 12:16:04 +02:00
preprocessor.cpp Suppressions: Add special case for backwards compatibility. suppression comment after a {. 2020-10-02 18:56:26 +02:00
preprocessor.h Update Copyright year 2020-10-03 09:15:56 +02:00
programmemory.cpp Fix gcc11 build errors () 2020-12-19 21:54:19 +01:00
programmemory.h FIx issue 9895: ValueFlow: Wrong known value below function call with reference parameter 2020-09-11 16:03:57 -05:00
reverseanalyzer.cpp Add generic valueflowBeforeCondition () 2021-01-08 22:55:04 +01:00
reverseanalyzer.h Add generic reverse valueflow () 2020-11-10 16:00:55 +01:00
settings.cpp ExprEngine; Use 60s as default maxtime processing a function, the analysis time will be somewhat reasonable 2020-12-22 21:09:24 +01:00
settings.h Summaries: Moved to its own files 2020-12-20 19:53:58 +01:00
standards.h Update Copyright year 2020-10-03 09:15:56 +02:00
summaries.cpp Summaries: Moved to its own files 2020-12-20 19:53:58 +01:00
summaries.h Visual Studio; Try to fix compilation 2020-12-20 21:01:45 +01:00
suppressions.cpp Fix CodeQL warning, Multiplication result converted to larger type 2020-11-06 19:50:05 +01:00
suppressions.h Fix CodeQL warning, Multiplication result converted to larger type 2020-11-06 19:50:05 +01:00
symboldatabase.cpp library: Refactor to use enum class () 2021-01-08 10:29:01 +01:00
symboldatabase.h ClangImport; set exprid 2021-01-06 11:03:43 +01:00
templatesimplifier.cpp fix location of forward declaration of specialized template () 2021-01-09 20:00:35 +01:00
templatesimplifier.h remove cleanupAfterSimplify from the template simplifier () 2020-12-31 09:33:23 +01:00
timer.cpp fixed and enabled some more clang-tidy warnings () 2021-01-05 17:51:32 +01:00
timer.h Check for JSON error when parsing addon .json files + fixes () 2019-11-20 15:37:09 +01:00
token.cpp Fix issue 10076: ValueFlow: False positive after address of var is taken 'T t = {{&var}};' () 2021-01-08 10:29:32 +01:00
token.h Running astyle [ci skip] 2020-12-27 12:38:21 +01:00
tokenize.cpp some self-check suppression cleanups () 2021-01-09 20:32:38 +01:00
tokenize.h some self-check suppression cleanups () 2021-01-09 20:32:38 +01:00
tokenlist.cpp some self-check suppression cleanups () 2021-01-09 20:32:38 +01:00
tokenlist.h some self-check suppression cleanups () 2021-01-09 20:32:38 +01:00
utils.cpp Refactorization: Moved code from header to source 2020-05-19 08:35:12 +02:00
utils.h Fixed compilation (next attempt): Added more missing includes 2020-05-19 08:53:38 +02:00
valueflow.cpp ValueFlow: Fixed isEqual 2021-01-10 16:52:11 +01:00
valueflow.h Fix issue 8650: ValueFlow: Track if pointer is created by '&' operator () 2021-01-05 16:56:38 +01:00
valueptr.h Update copyright year 2020-05-10 11:16:32 +02:00
version.h 2.3: Update version 2020-12-05 10:00:02 +01:00
version.rc