Date: prev next · Thread: first prev next last
2014 Archives by date, by thread · List index


On Saturday 26 of April 2014, julien2412 wrote:
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?

 Yes, it looks bogus.

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?

 The sizes are constants, there's no such problem.

-- 
 Lubos Lunak
 l.lunak@collabora.com

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.