Community
Participate
Working Groups
Build Identifier: Hi cppcheck (1.44) reports the following against org.eclipse.swt/Eclipse SWT PI/win32/library/gdip_custom.cpp [gdip_custom.cpp:39]: (error) Mismatching allocation and deallocation: points [gdip_custom.cpp:65]: (error) Mismatching allocation and deallocation: points [gdip_custom.cpp:91]: (error) Mismatching allocation and deallocation: points [gdip_custom.cpp:117]: (error) Mismatching allocation and deallocation: points [gdip_custom.cpp:182]: (error) Mismatching allocation and deallocation: colors [gdip_custom.cpp:211]: (error) Mismatching allocation and deallocation: colors [gdip_custom.cpp:240]: (error) Mismatching allocation and deallocation: colors [gdip_custom.cpp:271]: (error) Mismatching allocation and deallocation: points [gdip_custom.cpp:342]: (error) Mismatching allocation and deallocation: points I checked a few of them and it is triggered by code like: ... Color *colors=NULL; ... colors = new Color[arg3]; .... if (lparg1 && colors) { delete colors; } ... I believe the correction would be to use delete[] in this particular case. Note I did not manually verify all of them. ~Niels Reproducible: Always
Fixed in HEAD Thank you. Intersting, the file (gdip_custom.cpp) had other instances of delete array that the tool didn't find.