Advertisement
PVS-StudioWarnings

PVS-Studio warning V523 for samba

Nov 27th, 2014
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.86 KB | None | 0 0
  1. static uint32 reg_perfcount_get_perf_data_block(....)
  2. {
  3.   ....
  4.   if(object_ids == NULL)
  5.   {
  6.     /* we're getting a request for "Global" here */
  7.     retval = _reg_perfcount_assemble_global(block, mem_ctx,
  8.                                             base_index, names);
  9.   }
  10.   else
  11.   {
  12.     /* we're getting a request for a specific
  13.        set of PERF_OBJECT_TYPES */
  14.     retval = _reg_perfcount_assemble_global(block, mem_ctx,
  15.                                             base_index, names);
  16.   }
  17.   ....
  18. }
  19.  
  20. This suspicious code was found in samba project by PVS-Studio static code analyzer.
  21. Warning message is:
  22. V523 The 'then' statement is equivalent to the 'else' statement. reg_perfcount.c 1092
  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
Advertisement