PVS-StudioWarnings

PVS-Studio warning V611 for Newton Game Dynamics

Nov 20th, 2014
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.82 KB | None | 0 0
  1. void dGeometryNodeSkinModifierInfo::RemoveUnusedVertices(
  2.   const int* const vertexMap)
  3. {
  4.   ....
  5.   dVector* vertexWeights = new dVector[m_vertexCount];
  6.   dBoneWeightIndex* boneWeightIndex =
  7.                            new dBoneWeightIndex[m_vertexCount];
  8.   ....
  9.   delete boneWeightIndex;
  10.   delete vertexWeights;
  11. }
  12.  
  13. This suspicious code was found in Newton Game Dynamics project by PVS-Studio static code analyzer.
  14. Warning message is:
  15. V611 The memory was allocated using 'new T[]' operator but was released using the 'delete' operator. Consider inspecting this code. It's probably better to use 'delete [] boneWeightIndex;'. dgeometrynodeskinmodifierinfo.cpp 97
  16.  
  17. PVS-Studio is a static analyzer for detecting bugs in the source code of applications written in C, C++, C++11, C++/CX. Site: http://www.viva64.com/en/pvs-studio/
Advertisement
Add Comment
Please, Sign In to add comment