I confirm the same with the latest production version:
$ cppcheck --version
Cppcheck 1.90
$ uname -a
Linux qipf14k7jn 5.4.0-0.bpo.2-amd64 #1 SMP Debian 5.4.8-1~bpo10+1 (2020-01-07) x86_64 GNU/Linux
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for reporting this issue.
It looks like there is already a ticket in the bug tracker: https://trac.cppcheck.net/ticket/9437 (FP: Double free on realloc check)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This correctly generates [memleakOnRealloc]
However, when corrected to this:
It incorrectly generates [doubleFree]
$ cppcheck --version
Cppcheck 1.89
$ uname -a
Linux qipk2dyy8 5.2.0-0.bpo.2-amd64 #1 SMP Debian 5.2.9-2~bpo10+1 (2019-08-25) x86_64 GNU/Linux
I confirm the same with the latest production version:
$ cppcheck --version
Cppcheck 1.90
$ uname -a
Linux qipf14k7jn 5.4.0-0.bpo.2-amd64 #1 SMP Debian 5.4.8-1~bpo10+1 (2020-01-07) x86_64 GNU/Linux
Thanks for reporting this issue.
It looks like there is already a ticket in the bug tracker: https://trac.cppcheck.net/ticket/9437 (FP: Double free on realloc check)