Advertisement
PVS-StudioWarnings

PVS-Studio warning V530 for Chromium

Nov 21st, 2014
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.76 KB | None | 0 0
  1. std::wstring url_;
  2.  
  3. HRESULT ProtData::ReportProgress(IInternetProtocolSink* delegate,
  4.                                  ULONG status_code,
  5.                                  LPCWSTR status_text)
  6. {
  7.   ...
  8.   case BINDSTATUS_REDIRECTING:
  9.     url_.empty();
  10.     if (status_text)
  11.       url_ = status_text;
  12.     break;
  13.   ...
  14. }
  15.  
  16. This is what should have been written here: url_.clear();
  17.  
  18. This suspicious code was found in Chromium project by PVS-Studio static code analyzer.
  19. Warning message is:
  20. V530 The return value of function 'empty' is required to be utilized.  chrome_frame_ie  protocol_sink_wrap.cc  399
  21.  
  22. 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