PVS-StudioWarnings

PVS-Studio warning V614 for TPP

Nov 18th, 2014
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.69 KB | None | 0 0
  1. int main(int argc, char** argv) {
  2.   ....
  3.   ramp_fileoffset_t *pScanIndex;
  4.   ....
  5.   if ( (pFI=rampOpenFile(mzXmlPath_.c_str()))==NULL) {
  6.     ....
  7.   } else {
  8.     ....
  9.     pScanIndex = readIndex(pFI, indexOffset,
  10.                            &iAnalysisLastScan );
  11.     ....
  12.   }
  13.   ....
  14.   if (pScanIndex != NULL)
  15.     free(pScanIndex);
  16.  
  17.   return 0;
  18. }
  19.  
  20. This suspicious code was found in TPP project by PVS-Studio static code analyzer.
  21. Warning message is:
  22. V614 Potentially uninitialized pointer 'pScanIndex' used. sqt2xml.cxx 476
  23.  
  24. 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