PVS-StudioWarnings

PVS-Studio warning V509 for NetXMS

Nov 17th, 2014
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.71 KB | None | 0 0
  1. CNodePerfView::~CNodePerfView()
  2. {
  3.   WorkerTask *pTask;
  4.   while((pTask = (WorkerTask *)m_workerQueue.Get()) != NULL)
  5.     delete pTask;
  6.   m_workerQueue.Put(new WorkerTask(NULL, TASK_SHUTDOWN));
  7.   ThreadJoin(m_hWorkerThread);
  8.   safe_free(m_pGraphList);
  9. }
  10.  
  11. This suspicious code was found in NetXMS project by PVS-Studio static code analyzer.
  12. Warning message is:
  13. V509 The 'new' operator should be located inside the try..catch block, as it could potentially generate an exception. Raising exception inside the destructor is illegal. nodeperfview.cpp 109
  14.  
  15. 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