PVS-StudioWarnings

PVS-Studio warning V586 for OpenMW

Nov 19th, 2014
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.65 KB | None | 0 0
  1. void Clothing::blank()
  2. {
  3.   mData.mType = 0;
  4.   mData.mWeight = 0;
  5.   mData.mValue = 0;
  6.   mData.mEnchant = 0;
  7.   mParts.mParts.clear();
  8.   mName.clear();
  9.   mModel.clear();
  10.   mIcon.clear();
  11.   mIcon.clear();
  12.   mEnchant.clear();
  13.   mScript.clear();
  14. }
  15.  
  16. This suspicious code was found in OpenMW project by PVS-Studio static code analyzer.
  17. Warning message is:
  18. V586 The 'clear' function is called twice for deallocation of the same resource. Check lines: 48, 49. components loadclot.cpp 49
  19.  
  20. 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