PVS-StudioWarnings

PVS-Studio warning V523 for UCSniff

Nov 20th, 2014
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.92 KB | None | 0 0
  1. int openreceivehandler(....)
  2. {
  3.   ...
  4.  int return_rtp = check_rtp_entry(ip);
  5.  if (return_rtp < 0) {
  6.    int return_value = populate_rtp_struct(return_rtp, ip,
  7.                                           passthrupartyid,
  8.                                           rtpport);
  9.    if(return_value == -1) {
  10.      return NULL;
  11.    }
  12.  } else {
  13.    int return_value = populate_rtp_struct(return_rtp, ip,
  14.                                           passthrupartyid,
  15.                                           rtpport);
  16.    if (return_value == -1) {
  17.      return NULL;
  18.    }
  19.  }
  20.   ...
  21. }
  22.  
  23. This suspicious code was found in UCSniff project by PVS-Studio static code analyzer.
  24. Warning message is:
  25. V523 The 'then' statement is equivalent to the 'else' statement.  ec_sccp.c 3216
  26.  
  27. 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