#2721: possible issues found by cppcheck
-------------------------------------+-----------------------
        Reporter:  pabs              |        Type:  bug
          Status:  new               |    Priority:  normal
       Milestone:  unspecified       |   Component:  other
         Version:  git/master        |    Keywords:  cppcheck
Operating System:  All/Non-Specific  |  Blocked By:
        Blocking:                    |
-------------------------------------+-----------------------
 In git master (f68e667c3d1e3512ce4b16e873112310bcad7b43), cppcheck 1.48
 finds the following possible issues:

 {{{
 [lib/betawidget/src/svgManager.cpp:107]: (error) Memory leak: svg.filename
 [src/display3d.cpp:2315]: (error) Possible null pointer dereference:
 psStructure - otherwise it is redundant to check if psStructure is null at
 line 2343
 [src/display3d.cpp:2317]: (error) Possible null pointer dereference:
 psStructure - otherwise it is redundant to check if psStructure is null at
 line 2343
 [src/display3d.cpp:794]: (error) Null pointer dereference
 [src/scriptcb.cpp:75]: (error) Array 'ConsoleMsg[255]' index 255 out of
 bounds
 [tests/modeltest.c:230]: (error) Resource leak: fp
 [tools/display/wzmutils.c:347]: (error) Resource leak: fp
 [tools/display/wzmutils.c:556]: (error) Resource leak: fp
 [tools/editworld/src/heightmap.h:855]: (portability) Extra qualification
 'CHeightMap::' unnecessary and considered an error by many compilers.
 [tools/editworld/src/brush.cpp:807]: (error) Array 'm_EdgeBrush[13]' index
 13 out of bounds
 [tools/editworld/src/brush.cpp:425]: (error) Uninitialized variable: dc
 [tools/editworld/src/directx.cpp:2871]: (error) Possible null pointer
 dereference: DeviceTexture - otherwise it is redundant to check if
 DeviceTexture is null at line 2873
 [tools/editworld/src/directx.cpp:199]: (error) Possible null pointer
 dereference: UserProfile - otherwise it is redundant to check if
 UserProfile is null at line 183
 [tools/editworld/src/directx.cpp:200]: (error) Possible null pointer
 dereference: UserProfile - otherwise it is redundant to check if
 UserProfile is null at line 183
 [tools/editworld/src/fileparse.cpp:61]: (error) Mismatching allocation and
 deallocation: fileParser::m_File
 [tools/editworld/src/bteditdoc.cpp:2221]: (error) Deallocating a
 deallocated pointer: Stream
 [tools/editworld/src/bteditdoc.cpp:3349]: (error) Resource leak: Stream
 [tools/editworld/src/bteditdoc.cpp:3638]: (error) Mismatching allocation
 and deallocation: TileBuf
 [tools/editworld/src/bteditdoc.cpp:3716]: (error) Mismatching allocation
 and deallocation: TileBuf
 [tools/editworld/src/directx.cpp:3606]: (error) Mismatching allocation and
 deallocation: CSurface::m_RGBLookup
 [tools/editworld/src/directx.cpp:3607]: (error) Mismatching allocation and
 deallocation: CSurface::m_RedLookup
 [tools/editworld/src/directx.cpp:3608]: (error) Mismatching allocation and
 deallocation: CSurface::m_GreenLookup
 [tools/editworld/src/directx.cpp:3609]: (error) Mismatching allocation and
 deallocation: CSurface::m_BlueLookup
 [tools/editworld/src/bteditdoc.cpp:863]: (error) Uninitialized variable:
 dc
 [tools/editworld/src/bteditdoc.cpp:1161]: (error) Uninitialized variable:
 dc
 [tools/editworld/src/bteditdoc.cpp:1230]: (error) Uninitialized variable:
 dc
 [tools/editworld/src/bteditdoc.cpp:2700]: (error) Uninitialized variable:
 dc
 [tools/editworld/src/bteditdoc.cpp:2809]: (error) Uninitialized variable:
 dc
 [tools/editworld/src/bteditdoc.cpp:2907]: (error) Uninitialized variable:
 dc
 [tools/editworld/src/bteditdoc.cpp:3015]: (error) Uninitialized variable:
 dc
 [tools/editworld/src/bteditdoc.cpp:3088]: (error) Uninitialized variable:
 dc
 [tools/editworld/src/heightmap.cpp:728]: (error) Mismatching allocation
 and deallocation: PageBits
 [tools/editworld/src/heightmap.cpp:4342]: (error) Resource leak: Stream
 [tools/editworld/src/heightmap.cpp:4862]: (error) Mismatching allocation
 and deallocation: Point
 [tools/editworld/src/textsel.cpp:329]: (error) Uninitialized variable: dc
 [tools/editworld/src/heightmap.cpp:4863]: (error) Mismatching allocation
 and deallocation: PointNormals
 [tools/editworld/src/heightmap.cpp:4478]: (error) Memory leak:
 PointNormals
 [tools/editworld/src/heightmap.cpp:4864]: (error) Mismatching allocation
 and deallocation: Triangle
 [tools/editworld/src/heightmap.cpp:6808]: (error) Mismatching allocation
 and deallocation: ScriptNames
 [tools/editworld/src/heightmap.cpp:6836]: (error) Mismatching allocation
 and deallocation: IDs
 [tools/map/map2lnd.c:131]: (error) Resource leak: fp
 [tools/map/mapconv.c:254]: (error) Resource leak: fp
 [tools/map/pngsave.c:84]: (error) Memory leak: row_pointers
 [tools/qwzm/conversion.cpp:457]: (error) Possible null pointer
 dereference: f - otherwise it is redundant to check if f is null at line
 463
 [tools/qwzm/wzmutils.c:602]: (error) Resource leak: fp

 }}}

-- 
Ticket URL: <http://developer.wz2100.net/ticket/2721>
Warzone 2100 Trac <http://developer.wz2100.net/>
The Warzone 2100 Project
_______________________________________________
Warzone-dev mailing list
[email protected]
https://mail.gna.org/listinfo/warzone-dev

Reply via email to