PVS-StudioWarnings

PVS-Studio warning V522 for VTK

Nov 18th, 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. VTK_THREAD_RETURN_TYPE vtkTestCondVarThread( void* arg )
  2. {
  3.   ...
  4.   if ( td )                  <<<---
  5.   {
  6.     ...
  7.   }
  8.   else
  9.   {
  10.     cout << "No thread data!\n";
  11.     cout << "  Thread " << ( threadId + 1 )
  12.          << " of " << threadCount << " exiting.\n";
  13.  
  14.     -- td->NumberOfWorkers;  <<<---
  15.  
  16.     cout.flush();
  17.   }
  18.   ...
  19. }
  20.  
  21. This suspicious code was found in VTK project by PVS-Studio static code analyzer.
  22. Warning message is:
  23. V522 Dereferencing of the null pointer 'td' might take place. CommonCxxTests testconditionvariable.cxx 96
  24.  
  25. 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