PVS-StudioWarnings

PVS-Studio warning V611 for Xerces

Nov 20th, 2014
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.59 KB | None | 0 0
  1. const XMLCh* PSVIWriterHandlers::getIdName(XSObject* obj) {
  2.   XMLCh* objLoc = new XMLCh[9];
  3.   ....
  4.   delete objLoc;
  5. }
  6.  
  7. This suspicious code was found in Xerces project by PVS-Studio static code analyzer.
  8. Warning message is:
  9. 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 [] objLoc;'. psviwriterhandlers.cpp 1631
  10.  
  11. 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