With cppcheck 2.11 I now get some autovarInvalidDeallocation false positives that I did not get with previous versions. At least I think it is false positive since I can't reason why it would be a error and because the error message seems wrongly put together making me think this is an edge case badly handled.
I can't reduce a small test case unfortunately as I don't understand exactly what trips it. But here is the "bad" message hoping it can help (the (() is particularly suspicious):
In all my FP, the delete pointer is initialized by taking the address of returned reference (not really a good pattern/practice).
I could not reduce this to a simple example with valid code. However, here is a broken code that produces the same message (again, I hope this can help):
With cppcheck 2.11 I now get some
autovarInvalidDeallocation
false positives that I did not get with previous versions. At least I think it is false positive since I can't reason why it would be a error and because the error message seems wrongly put together making me think this is an edge case badly handled.I can't reduce a small test case unfortunately as I don't understand exactly what trips it. But here is the "bad" message hoping it can help (the
(()
is particularly suspicious):In all my FP, the delete pointer is initialized by taking the address of returned reference (not really a good pattern/practice).
I could not reduce this to a simple example with valid code. However, here is a broken code that produces the same message (again, I hope this can help):
Thanks for reporting, fixed by https://github.com/danmar/cppcheck/pull/5203