Cppcheck reports "Deallocation of an auto-variable results in undefined behaviour" in vcl part

julien2412 serval2412 at yahoo.fr
Sat Apr 26 09:40:18 PDT 2014


Hello,

Cppcheck reported this:
[vcl/source/gdi/bitmap4.cxx:229]: (error) Deallocation of an auto-variable
results in undefined behaviour
137             long            (*pKoeff)[ 256 ] = new long[ 9 ][ 256 ];
...
229             delete[] pKoeff;
See http://opengrok.libreoffice.org/xref/core/vcl/source/gdi/bitmap4.cxx#137

False positive?
Moreover, I searched info about declaring 2D arrays and this notation new
T[x][y] isn't supposed to work (see
http://stackoverflow.com/questions/936687/how-do-i-declare-a-2d-array-in-c-using-new)
Any idea?

Julien 



--
View this message in context: http://nabble.documentfoundation.org/Cppcheck-reports-Deallocation-of-an-auto-variable-results-in-undefined-behaviour-in-vcl-part-tp4106524.html
Sent from the Dev mailing list archive at Nabble.com.


More information about the LibreOffice mailing list