PVS-StudioWarnings

PVS-Studio warning V611 for VirtualBox

Nov 19th, 2014
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.69 KB | None | 0 0
  1. void
  2. ReadTSMF(uint32_t u32ChannelHandle,
  3.          uint32_t u32HGCMClientId,
  4.          uint32_t u32SizeAvailable)
  5. {
  6.   ....
  7.   PBYTE pBuffer = (PBYTE)malloc(u32SizeAvailable + sizeof(....));
  8.   ....
  9.   delete [] pBuffer;
  10.   ....
  11. }
  12.  
  13. This suspicious code was found in VirtualBox project by PVS-Studio static code analyzer.
  14. Warning message is:
  15. V611 The memory was allocated using 'malloc/realloc' function but was released using the 'delete' operator. Consider inspecting operation logics behind the 'pBuffer' variable. tsmfhook.cpp 1261
  16.  
  17. 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