Advertisement
PVS-StudioWarnings

PVS-Studio warning V571 for MTASA

Nov 24th, 2014
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.89 KB | None | 0 0
  1. int CLuaFunctionDefs::XMLNodeGetName ( lua_State* luaVM )
  2. {
  3.   CXMLNode* pNode = NULL;
  4.   CScriptArgReader argStream ( luaVM );
  5.   argStream.ReadUserData ( pNode );
  6.  
  7.   if ( !argStream.HasErrors ( ) )
  8.   {
  9.     if ( pNode )
  10.     {
  11.       if ( pNode )
  12.       {
  13.         lua_pushstring (
  14.           luaVM, pNode->GetTagName ().c_str () );
  15.         return 1;
  16.       }
  17.     }
  18.   }
  19.   else
  20.     m_pScriptDebugging->LogCustom (
  21.       luaVM, argStream.GetFullErrorMessage() );
  22.  
  23.   lua_pushboolean ( luaVM, false );
  24.   return 1;
  25. }
  26.  
  27. This suspicious code was found in MTASA project by PVS-Studio static code analyzer.
  28. Warning message is:
  29. V571 Recurring check. The 'if (pNode)' condition was already verified in line 162. cluafunctiondefs.xml.cpp 164
  30.  
  31. 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
Advertisement