PVS-StudioWarnings

PVS-Studio warning V614 for NetXMS

Nov 10th, 2014
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.55 KB | None | 0 0
  1. int OdbcDisconnect(void* pvSqlCtx)
  2. {
  3.   ....
  4.   SQLRETURN nSqlRet;
  5.   ....
  6.   if (nRet == SUCCESS)
  7.   {
  8.     ....
  9.     nSqlRet = SQLDisconnect(pSqlCtx->hDbc);
  10.     ....
  11.   }
  12.   if (SQLRET_FAIL(nSqlRet))
  13.   ....
  14. }
  15.  
  16. This suspicious code was found in NetXMS project by PVS-Studio static code analyzer.
  17. Warning message is:
  18. V614 Potentially uninitialized variable 'nSqlRet' used. odbcsapi.cpp 220
  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