Our website uses cookies to enhance your browsing experience.
Accept
to the top
close form

Fill out the form in 2 simple steps below:

Your contact information:

Step 1
Congratulations! This is your promo code!

Desired license type:

Step 2
Team license
Enterprise license
** By clicking this button you agree to our Privacy Policy statement
close form
Request our prices
New License
License Renewal
--Select currency--
USD
EUR
* By clicking this button you agree to our Privacy Policy statement

close form
Free PVS‑Studio license for Microsoft MVP specialists
* By clicking this button you agree to our Privacy Policy statement

close form
To get the licence for your open-source project, please fill out this form
* By clicking this button you agree to our Privacy Policy statement

close form
I am interested to try it on the platforms:
* By clicking this button you agree to our Privacy Policy statement

close form
check circle
Message submitted.

Your message has been sent. We will email you at


If you haven't received our response, please do the following:
check your Spam/Junk folder and click the "Not Spam" button for our message.
This way, you won't miss messages from our team in the future.

>
>
>
Examples of errors detected by the V668…

Examples of errors detected by the V668 diagnostic

V668. Possible meaningless check for null, as memory was allocated using 'new' operator. Memory allocation will lead to an exception.


NetXMS

V668 There is no sense in testing the 'val' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. calltip.cpp 260


PRectangle CallTip::CallTipStart(....)
{
  ....
  val = new char[strlen(defn) + 1];
  if (!val)
    return PRectangle();
  ....
}

Similar errors can be found in some other places:

  • V668 There is no sense in testing the 'actionsNew' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. cellbuffer.cpp 153
  • V668 There is no sense in testing the 'pwNew' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. document.cpp 1377
  • V668 There is no sense in testing the 'pwNew' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. document.cpp 1399
  • And 23 additional diagnostic messages.

TortoiseSVN

V668 There is no sense in testing the 'pBuf' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. subwcrev.cpp 912


int _tmain(....)
{
  ....
  pBuf = new char[maxlength];
  if (pBuf == NULL)
  {
    _tprintf(_T("Could not allocate enough memory!\n"));
    delete [] wc;
    delete [] dst;
    delete [] src;
    return ERR_ALLOC;
  }
  ....
}

Similar errors can be found in some other places:

  • V668 There is no sense in testing the 'pdobj' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. repositorybrowser.cpp 2565
  • V668 There is no sense in testing the 'pdobj' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. repositorybrowser.cpp 4225
  • V668 There is no sense in testing the 'pdobj' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. svnstatuslistctrl.cpp 5254
  • And 8 additional diagnostic messages.

WebRTC

V668 There is no sense in testing the 'in_audio_' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. acm_generic_codec.cc 568


int16_t ACMGenericCodec::InitEncoderSafe(....)
{
  ....
  in_audio_ = new int16_t[AUDIO_BUFFER_SIZE_W16];
  if (in_audio_ == NULL) {
    return -1;
  }
  ....
}

Similar errors can be found in some other places:

  • V668 There is no sense in testing the 'in_timestamp_' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. acm_generic_codec.cc 575
  • V668 There is no sense in testing the 'codec_inst_ptr_' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. acm_isac.cc 344
  • V668 There is no sense in testing the 'dummy_rtp_header_' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. audio_coding_module_impl.cc 2569
  • And 2 additional diagnostic messages.

Chromium

V668 There is no sense in testing the 'popup_' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. try_chrome_dialog_view.cc 90


TryChromeDialogView::Result TryChromeDialogView::ShowModal(
  const ActiveModalDialogListener& listener)
{
  ....
  popup_ = new views::Widget;
  if (!popup_) {
    NOTREACHED();
    return DIALOG_ERROR;
  }
  ....
}

Chromium

V668 There is no sense in testing the 'udp_socket' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. network_stats.cc 212


bool NetworkStats::DoConnect(int result) {
  ....
  net::UDPClientSocket* udp_socket =
      new net::UDPClientSocket(....);
  if (!udp_socket) {
    Finish(SOCKET_CREATE_FAILED, net::ERR_INVALID_ARGUMENT);
    return false;
  }
  ....
}

Chromium

V668 There is no sense in testing the 'current_browser' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. print_preview_dialog_controller.cc 403


WebContents*
PrintPreviewDialogController::CreatePrintPreviewDialog(
  WebContents* initiator)
{
  ....
  Browser* current_browser = new Browser(
      Browser::CreateParams(Browser::TYPE_POPUP, profile,
                            chrome::GetActiveDesktop()));
  if (!current_browser) {
    NOTREACHED() << "Failed to create popup browser window";
    return NULL;
  }
  ....
}

Chromium

V668 There is no sense in testing the 'dict' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. peer_connection_tracker.cc 164


static base::DictionaryValue* GetDictValueStats(
    const webrtc::StatsReport& report)
{
  ....
  DictionaryValue* dict = new base::DictionaryValue();
  if (!dict)
    return NULL;

  dict->SetDouble("timestamp", report.timestamp);

  base::ListValue* values = new base::ListValue();
  if (!values) {
    delete dict;
    return NULL;
  }
  ....
}

Similar errors can be found in some other places:

  • V668 There is no sense in testing the 'values' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. peer_connection_tracker.cc 169

Chromium

V668 There is no sense in testing the 'cache' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. crash_cache.cc 269


int LoadOperations(....)
{
  ....
  disk_cache::BackendImpl* cache = new disk_cache::BackendImpl(
    path, 0xf, cache_thread->message_loop_proxy().get(), NULL);
  if (!cache || !cache->SetMaxSize(0x100000))
    return GENERIC;
  ....
}

Chromium

V668 There is no sense in testing the 'sender_' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. crash_service.cc 221


bool CrashService::Initialize(const std::wstring& command_line)
{
  ....
    sender_ = new CrashReportSender(checkpoint_path.value());
    if (!sender_) {
      LOG(ERROR) << "could not create sender";
      return false;
    }
  ....
}

Chromium

V668 There is no sense in testing the 'ctx_' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. target.cc 73


bool Target::Init() {
{
  ....
  ctx_ = new uint8_t[abi_->GetContextSize()];

  if (NULL == ctx_) {
    Destroy();
    return false;
  }
  ....
}

Similar errors can be found in some other places:

  • V668 There is no sense in testing the 'data' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. target.cc 109

Chromium

V668 There is no sense in testing the 'port_data' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. port_monitor.cc 388


BOOL WINAPI Monitor2OpenPort(HANDLE, wchar_t*, HANDLE* handle)
{
  PortData* port_data = new PortData();
  if (port_data == NULL) {
    LOG(ERROR) <<
      "Unable to allocate memory for internal structures.";
    SetLastError(E_OUTOFMEMORY);
    return FALSE;
  }
  ....
}

Similar errors can be found in some other places:

  • V668 There is no sense in testing the 'xcv_data' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. port_monitor.cc 552
  • V668 There is no sense in testing the 'monitor_data' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. port_monitor.cc 625

Hunspell

V668 There is no sense in testing the 'iterator' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. affixmgr.cxx 297


int AffixMgr::parse_file(const char * affpath, const char * key)
{
  ....
  FileMgr* iterator = new FileMgr(&affix_iterator);
  if (!iterator) {
    HUNSPELL_WARNING(stderr,
      "error: could not create a FileMgr "
      "from an affix line iterator.\n");
    return 1;
  }
  ....
}

Similar errors can be found in some other places:

  • V668 There is no sense in testing the 'afflst' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. hashmgr.cxx 736
  • V668 There is no sense in testing the 'afflst' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. affixmgr.cxx 317

ICU

V668 There is no sense in testing the 'collation' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. coll.cpp 365


Collator* Collator::makeInstance(....)
{
  ....
  RuleBasedCollator* collation =
    new RuleBasedCollator(desiredLocale, status);
  /* test for NULL */
  if (collation == 0) {
      status = U_MEMORY_ALLOCATION_ERROR;
      return 0;
  }
  ....
}

#info P.S. /* test for NULL */ - A not so super comment. :)

ICU

V668 There is no sense in testing the 'fChoiceFormats' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. choicfmt.cpp 177


ChoiceFormat::operator=(const ChoiceFormat& that)
{
  ....
  fChoiceLimits = (double*)
    uprv_malloc( sizeof(double) * fCount);
  fClosures = (UBool*) uprv_malloc( sizeof(UBool) * fCount);
  fChoiceFormats = new UnicodeString[fCount];

  // check for memory allocation error
  if (!fChoiceLimits || !fClosures || !fChoiceFormats)
  {
    if (fChoiceLimits) {
      uprv_free(fChoiceLimits);
      fChoiceLimits = NULL;
    }
    if (fClosures) {
      uprv_free(fClosures);
      fClosures = NULL;
    }
    if (fChoiceFormats) {
      delete[] fChoiceFormats;
      fChoiceFormats = NULL;
    }
  }
  ....
}

Similar errors can be found in some other places:

  • V668 There is no sense in testing the 'newFormats' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. choicfmt.cpp 354
  • V668 There is no sense in testing the 'fChoiceFormats' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. choicfmt.cpp 553
  • V668 There is no sense in testing the 'ret' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. calendar.cpp 425
  • And 198 additional diagnostic messages.

ANGLE

V668 There is no sense in testing the 'mStreamingBuffer' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. vertexdatamanager.cpp 49


VertexDataManager::VertexDataManager(....) : mRenderer(renderer)
{
  ....
  mStreamingBuffer = new
    StreamingVertexBufferInterface(renderer,
                                   INITIAL_STREAM_BUFFER_SIZE);

  if (!mStreamingBuffer)
  {
    ERR("Failed to allocate the streaming vertex buffer.");
  }
}

Similar errors can be found in some other places:

  • V668 There is no sense in testing the 'lpThreadData' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. initializeparsecontext.cpp 61
  • V668 There is no sense in testing the 'memory' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. poolalloc.cpp 273
  • V668 There is no sense in testing the 'memory' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. poolalloc.cpp 295

libyuv

V668 There is no sense in testing the 'buf' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. convert_to_argb.cc 69


LIBYUV_API
int ConvertToARGB(....)
{
  ....
  buf = new uint8[argb_size];
  if (!buf) {
    return 1;  // Out of memory runtime error.
  }
  ....
}

Similar errors can be found in some other places:

  • V668 There is no sense in testing the 'buf' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. convert_to_i420.cc 77

Chromium

V668 There is no sense in testing the 'type_enum' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. pin_base_win.cc 96


STDMETHOD(Clone)(IEnumMediaTypes** clone) {
  TypeEnumerator* type_enum = new TypeEnumerator(pin_);
  if (!type_enum)
    return E_OUTOFMEMORY;
  ....
}

Similar errors can be found in some other places:

  • V668 There is no sense in testing the 'pin_enum' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. filter_base_win.cc 75

WebRTC

V668 There is no sense in testing the '_ptrFileUtilityObj' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. media_file_impl.cc 536


int32_t MediaFileImpl::StartPlayingStream(....)
{
  ....
  _ptrFileUtilityObj = new ModuleFileUtility(_id);
  if(_ptrFileUtilityObj == NULL)
  {
      WEBRTC_TRACE(kTraceMemory, kTraceFile, _id,
                    "Failed to create FileUtilityObj!");
      return -1;
  }
  ....
}

Similar errors can be found in some other places:

  • V668 There is no sense in testing the '_aviVideoInFile' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. media_file_utility.cc 312
  • V668 There is no sense in testing the '_aviAudioInFile' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. media_file_utility.cc 360
  • V668 There is no sense in testing the '_ptrFileUtilityObj' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. media_file_impl.cc 1001
  • And 15 additional diagnostic messages.

Chromium

V668 There is no sense in testing the 'c_protocols' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. websocket.cc 44


int32_t WebSocket::Connect(....)
{
  ....
  if (protocol_count) {
    c_protocols = new PP_Var[protocol_count];
    if (!c_protocols)
      return PP_ERROR_NOMEMORY;
  }
  ....
}

Chromium

V668 There is no sense in testing the 'module' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. pepper_entrypoints.cc 39


int32_t PPP_InitializeModule(....)
{
  ChromotingModule* module = new ChromotingModule();
  if (!module)
    return PP_ERROR_FAILED;
  ....
}

Chromium

V668 There is no sense in testing the 'page_data' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. mock_printer.cc 229


void MockPrinter::PrintPage(....) {
  ....
  MockPrinterPage* page_data = new MockPrinterPage(....);
  if (!page_data) {
    printer_status_ = PRINTER_ERROR;
    return;
  }
  ....
}

Multi Theft Auto

V668 There is no sense in testing the 'attrib' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. tinyxmlparser.cpp 1093


const char* TiXmlElement::Parse(....)
{
  ....
  TiXmlAttribute* attrib = new TiXmlAttribute();
  if ( !attrib )
  {
    if ( document )
      document->SetError( TIXML_ERROR_OUT_OF_MEMORY, pErr,
                          data, encoding );
    return 0;
  }
  ....
}

Similar errors can be found in some other places:

  • V668 There is no sense in testing the 'ppScreenData' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. cfileformatpng.cpp 266
  • V668 There is no sense in testing the 'ppScreenData' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. cscreenshot.cpp 180
  • V668 There is no sense in testing the 'pDisplay' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. cluamain.cpp 575
  • And 16 additional diagnostic messages.

TinyCAD

V668 There is no sense in testing the 'SortArray' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. imagepng.cpp 935


bool CImagePNG::SubdivColorMap(....)
{
  ....
  if ((SortArray = new QuantizedColorType*[....]) == NULL)
    return ERROR;
  ....
}

Similar errors can be found in some other places:

  • V668 There is no sense in testing the 'lpBMIH' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. imagepng.cpp 162

OpenMS

V668 There is no sense in testing the 'node_vectors' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. libsvmencoder.c 177


svm_problem * LibSVMEncoder::encodeLibSVMProblem(....)
{
  ....
  node_vectors = new svm_node *[problem->l];
  if (node_vectors == NULL)
  {
    delete[] problem->y;
    delete problem;
    return NULL;
  }
  ....
}

Similar errors can be found in some other places:

  • V668 There is no sense in testing the 'p' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. file_page.h 728
  • V668 There is no sense in testing the 'problem' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. libsvmencoder.c 160

Snes9x

V668 There is no sense in testing the 'buffer' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. statemanager.cpp 83


bool StateManager::init(size_t buffer_size) {
  ....
  if (!(buffer = new uint64_t[buf_size]))
    return false;
  if (!(tmp_state = new uint32_t[state_size]))
    return false;
  if (!(in_state = new uint32_t[state_size]))
    return false;
  ....
}

Similar errors can be found in some other places:

  • V668 There is no sense in testing the 'tmp_state' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. statemanager.cpp 85
  • V668 There is no sense in testing the 'in_state' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. statemanager.cpp 87
  • V668 There is no sense in testing the 'XDelta' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. blit.cpp 201
  • And 4 additional diagnostic messages.

VirtualDub

V668 There is no sense in testing the 'next' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. VirtualDub hexviewer.cpp 2012


void HexEditor::Find(HWND hwndParent) {
  ....
  int *next = new int[nFindLength+1];
  char *searchbuffer = new char[65536];
  char *revstring = new char[nFindLength];
  ....
  if (!next || !searchbuffer || !revstring) {
    delete[] next;
    delete[] searchbuffer;
    delete[] revstring;
    return;
  }
  ....
}

Similar errors can be found in some other places:

  • V668 There is no sense in testing the 'dpt' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. VirtualDub icdriver.cpp 84
  • V668 There is no sense in testing the 'fa->filter_data' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. VirtualDub f_emboss.cpp 103
  • V668 There is no sense in testing the 'pcsd' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. VirtualDub capspill.cpp 303
  • And 72 additional diagnostic messages.

Geant4 software

V668 There is no sense in testing the 'theProcessList' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. g4processmanager.cc 69


G4ProcessManager::G4ProcessManager(....)
{
  ....
  theProcessList = new G4ProcessVector();
  if ( theProcessList == 0) {
    G4Exception( "G4ProcessManager::G4ProcessManager()",
                 "ProcMan012", FatalException,
                 "Can not create G4ProcessList ");
  }
  ....
}

Similar errors can be found in some other places:

  • V668 There is no sense in testing the 'theAttrVector' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. g4processmanager.cc 112
  • V668 There is no sense in testing the 'frot' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. g4grsvolume.icc 45
  • V668 There is no sense in testing the 'frot' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. g4grsvolume.icc 66
  • And 66 additional diagnostic messages.

OpenH264

V668 There is no sense in testing the 'pFr' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. WelsFrameWork.cpp 72


EResult CreateSpecificVpInterface (IWelsVP** ppCtx)
{
  EResult eReturn = RET_FAILED;

  CVpFrameWork* pFr = new CVpFrameWork (1, eReturn);
  if (pFr) {
    *ppCtx  = (IWelsVP*)pFr;
    eReturn = RET_SUCCESS;
  }

  return eReturn;
}

Similar errors can be found in some other places:

  • V668 There is no sense in testing the 'pVPc' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. WelsFrameWorkEx.cpp 70

CryEngine 3 SDK

V668 There is no sense in testing the 'm_pWriteBuffer' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. crylobbypacket.h 88


bool CreateWriteBuffer(uint32 bufferSize)
{
  FreeWriteBuffer();
  m_pWriteBuffer = new uint8[bufferSize];
  if (m_pWriteBuffer)
  {
    m_bufferSize = bufferSize;
    m_bufferPos = 0;
    m_allocated = true;
    return true;
  }
  return false;
}

Similar errors can be found in some other places:

  • V668 There is no sense in testing the 'p' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. cry_math.h 73
  • V668 There is no sense in testing the 'pBuffer' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. datapatchdownloader.cpp 106
  • V668 There is no sense in testing the 'pBuffer' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. datapatchdownloader.cpp 338
  • And 20 additional diagnostic messages.

V8 JavaScript Engine

V668 There is no sense in testing the 'newFormats' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. choicfmt.cpp 354


void
ChoiceFormat::applyPattern(....)
{
  ....
  UnicodeString *newFormats = new UnicodeString[count];
  if (newFormats == 0) {
    status = U_MEMORY_ALLOCATION_ERROR;
    uprv_free(newLimits);
    uprv_free(newClosures);
    return;
  }
  ....
}

Similar errors can be found in some other places:

  • V668 There is no sense in testing the 'result' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. allocation.h 85
  • V668 There is no sense in testing the 'patCEs' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. bmsearch.cpp 614
  • V668 There is no sense in testing the 'badCharacterTable' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. bmsearch.cpp 620
  • And 233 additional diagnostic messages.

ADAPTIVE Communication Environment (ACE)

V668 There is no sense in testing the 'option' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. get_opt.cpp 561


int
ACE_Get_Opt::long_option (const ACE_TCHAR *name,
                          int short_option,
                          OPTION_ARG_MODE has_arg)
{
  ....
  ACE_Get_Opt_Long_Option *option =
    new ACE_Get_Opt_Long_Option (name, has_arg, short_option);

  if (!option)
    return -1;
  ....
}

Similar errors can be found in some other places:

  • V668 There is no sense in testing the 'eh' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. task_timer.cpp 27
  • V668 There is no sense in testing the 'eh' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. task_timer.cpp 55
  • V668 There is no sense in testing the 'eh' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. task_timer.cpp 79

FlightGear

V668 There is no sense in testing the 'raw->tmpR' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. fgrgbtextureloader.cxx 209


static rawImageRec *RawImageOpen(std::istream& fin)
{
  ....
  if( (raw->tmpR =
         new unsigned char [raw->sizeX*raw->bpc]) == NULL )
  {
    RawImageClose(raw);
    return NULL;
  }
  ....
}

Similar errors can be found in some other places:

  • V668 There is no sense in testing the 'u' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. fgmsis.cpp 439
  • V668 There is no sense in testing the 'socket' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. fgoutputsocket.cpp 137
  • V668 There is no sense in testing the 'raw' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. fgrgbtextureloader.cxx 166
  • And 8 additional diagnostic messages.

Unreal Engine 4

V668 There is no sense in testing the 'pSensorFusion' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. oculusrifthmd.cpp 1594


void FOculusRiftHMD::Startup()
{
  ....
  pSensorFusion = new SensorFusion();
  if (!pSensorFusion)
  {
    UE_LOG(LogHMD, Warning,
      TEXT("Error creating Oculus sensor fusion."));
    return;
  }
  ....
}

Similar errors can be found in some other places:

  • V668 There is no sense in testing the 'NewNode' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. list.h 301
  • V668 There is no sense in testing the 'NewNode' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. list.h 332
  • V668 There is no sense in testing the 'NewNode' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. list.h 369
  • And 15 additional diagnostic messages.

WinSCP

V668 There is no sense in testing the 'ShellExt' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. dragext.cpp 554


STDMETHODIMP CShellExtClassFactory::CreateInstance(....)
{
  ....
  CShellExt* ShellExt = new CShellExt();
  if (NULL == ShellExt)
  {
    return E_OUTOFMEMORY;
  }
  ....
}

JavaScriptCore

V668 There is no sense in testing the 're' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. pcre_compile.cpp 2592


JSRegExp* jsRegExpCompile(....)
{
  ....
  JSRegExp* re = reinterpret_cast<JSRegExp*>(new char[size]);

  if (!re)
    return returnError(ERR13, errorPtr);
  ....
}

Similar errors can be found in some other places:

  • V668 There is no sense in testing the 'thread' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. threadingqt.cpp 173

Qt

V668 There is no sense in testing the 'penum' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. qwindowsmsaaaccessible.cpp 141


HRESULT STDMETHODCALLTYPE QWindowsEnumerate::Clone(
  IEnumVARIANT **ppEnum)
{
  QWindowsEnumerate *penum = 0;
  *ppEnum = 0;

  penum = new QWindowsEnumerate(array);
  if (!penum)
    return E_OUTOFMEMORY;
  ....
}

Similar errors can be found in some other places:

  • V668 There is no sense in testing the 'engine' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. main.cpp 127
  • V668 There is no sense in testing the 'p' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. qaudiodevicefactory.cpp 236
  • V668 There is no sense in testing the 'p' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. qaudiodevicefactory.cpp 263
  • And 7 additional diagnostic messages.

ANGLE

V668 There is no sense in testing the 'mStreamingBuffer' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. vertexdatamanager.cpp 69


VertexDataManager::VertexDataManager(Renderer *renderer) :
  mRenderer(renderer)
{
  ....
  mStreamingBuffer = new StreamingVertexBufferInterface(
    renderer, INITIAL_STREAM_BUFFER_SIZE);

  if (!mStreamingBuffer)
  {
      ERR("Failed to allocate the streaming vertex buffer.");
  }
  ....
}

Similar errors can be found in some other places:

  • V668 There is no sense in testing the 'memory' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. poolalloc.cpp 250
  • V668 There is no sense in testing the 'memory' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. poolalloc.cpp 272

OGDF

V668 There is no sense in testing the 'm_pChar' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. ogdf string.cpp 60


String::String()
{
  m_pChar = new char[1];
  if (m_pChar == 0) OGDF_THROW(InsufficientMemoryException);
  m_pChar[0] = 0;
  m_length = 0;
}

Similar errors can be found in some other places:

  • V668 There is no sense in testing the 'm_pChar' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. ogdf string.cpp 71
  • V668 There is no sense in testing the 'm_pChar' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. ogdf string.cpp 82
  • V668 There is no sense in testing the 'm_pChar' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. ogdf string.cpp 92
  • And 11 additional diagnostic messages.

TortoiseGit

V668 There is no sense in testing the 'IoBuffer' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. Utils hwsmtp.cpp 196


static SECURITY_STATUS ClientHandshakeLoop(....)
{
  ....
  IoBuffer = new UCHAR[IO_BUFFER_SIZE];
  if (IoBuffer == nullptr)
  {
    return SEC_E_INTERNAL_ERROR;
  }
  ....
}

Similar errors can be found in some other places:

  • V668 There is no sense in testing the 'pBitmap' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. Utils picture.cpp 346
  • V668 There is no sense in testing the 'pProjectProvider' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. Utils bugtraqassociations.cpp 121
  • V668 There is no sense in testing the 'buf' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. TortoiseGitUDiff unicodeutils.cpp 269
  • And 16 additional diagnostic messages.

Tesseract

V668 There is no sense in testing the 'label32_' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. libtesseract303 char_samp.h 73


void SetLabel(char_32 label) {
  if (label32_ != NULL) {
    delete []label32_;
  }
  label32_ = new char_32[2];
  if (label32_ != NULL) {
    label32_[0] = label;
    label32_[1] = 0;
  }
}

Similar errors can be found in some other places:

  • V668 There is no sense in testing the 'label32_' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. libtesseract303 char_samp.h 90
  • V668 There is no sense in testing the 'neurons_' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. libtesseract303 neural_net.h 134
  • V668 There is no sense in testing the 'col_' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. libtesseract303 beam_search.cpp 127
  • And 98 additional diagnostic messages.

TinyXML

V668 There is no sense in testing the 'attrib' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. oics tinyxml.cpp 735


void TiXmlElement::SetAttribute(
  const char * cname, const char * cvalue )
{
  ....
  TiXmlAttribute* attrib = new TiXmlAttribute( cname, cvalue );
  if ( attrib )
  {
    attributeSet.Add( attrib );
  }
  else
  {
    TiXmlDocument* document = GetDocument();
    if ( document ) document->SetError(
      TIXML_ERROR_OUT_OF_MEMORY, 0, 0, TIXML_ENCODING_UNKNOWN );
  }
  ....
}

Similar errors can be found in some other places:

  • V668 There is no sense in testing the 'clone' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. oics tinyxml.cpp 863
  • V668 There is no sense in testing the 'clone' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. oics tinyxml.cpp 1141
  • V668 There is no sense in testing the 'clone' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. oics tinyxml.cpp 1327
  • And 5 additional diagnostic messages.

Cocos2d-x

V668 There is no sense in testing the 'pRet' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. ccfloat.h 48


static __Float* create(float v)
{
  __Float* pRet = new __Float(v); // <=
  if (pRet)                       // <=
  {
    pRet->autorelease();
  }
  return pRet;
}

ITK

V668 There is no sense in testing the 'm_Matrices' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. itkfemlinearsystemwrappervnl.cxx 33


#define ITK_NULLPTR  nullptr

void LinearSystemWrapperVNL::InitializeMatrix(....)
{
  if( m_Matrices == ITK_NULLPTR )
  {
    m_Matrices = new MatrixHolder(m_NumberOfMatrices);
    if( m_Matrices == ITK_NULLPTR )
    {
      itkGenericExceptionMacro(....);
    }
  }
  ....
}

Similar errors can be found in some other places:

  • V668 There is no sense in testing the 'm_Vectors' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. itkfemlinearsystemwrappervnl.cxx 79
  • V668 There is no sense in testing the 'm_Solutions' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. itkfemlinearsystemwrappervnl.cxx 125
  • V668 There is no sense in testing the 'hdr' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. itkge4imageio.cxx 95
  • And 9 additional diagnostic messages.

Miranda NG

V668 There is no sense in testing the 'ar' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. ICQ icq_avatar.cpp 608


int CIcqProto::GetAvatarData(....)
{
  ....
  ar = new avatars_request(ART_GET); // get avatar
  if (!ar) { // out of memory, go away
    m_avatarsMutex->Leave();
    return 0;
  }
  ....
}

Similar errors can be found in some other places:

  • V668 There is no sense in testing the 'recentEntries' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. TabSRMM trayicon.cpp 336
  • V668 There is no sense in testing the 'ar' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. ICQ icq_avatar.cpp 677
  • V668 There is no sense in testing the 'ar' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. ICQ icq_avatar.cpp 1325
  • And 78 additional diagnostic messages.

LibreOffice

V668 There is no sense in testing the 'pImpl' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. file.cxx 663


extern "C" oslFileHandle
SAL_CALL osl_createFileHandleFromOSHandle(
  HANDLE     hFile,
  sal_uInt32 uFlags)
{
  if ( !IsValidHandle(hFile) )
      return 0; // EINVAL

  FileHandle_Impl * pImpl = new FileHandle_Impl(hFile);
  if (pImpl == 0)
  {
    // cleanup and fail
    (void) ::CloseHandle(hFile);
    return 0; // ENOMEM
  }
  ....
}

Similar errors can be found in some other places:

  • V668 There is no sense in testing the 'cl' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. python.cxx 147
  • V668 There is no sense in testing the 'orig' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. python.cxx 174
  • V668 There is no sense in testing the 'orig' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. python.cxx 201
  • And 123 additional diagnostic messages.

.NET CoreCLR

V668 There is no sense in testing the 'newChunk' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. ClrJit stresslog.h 552


FORCEINLINE BOOL GrowChunkList ()
{
  ....
  StressLogChunk * newChunk = new StressLogChunk (....);
  if (newChunk == NULL)
  {
    return FALSE;
  }
  ....
}

Similar errors can be found in some other places:

  • V668 There is no sense in testing the 'newChunk' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. ClrJit stresslog.h 573
  • V668 There is no sense in testing the 'buckets' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. cee_dac virtualcallstub.h 1581
  • V668 There is no sense in testing the 'strTemp' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. cee_dac formattype.cpp 1294
  • And 39 additional diagnostic messages.

GNU Octave

V668 There is no sense in testing the 'instance' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. oct-spparms.cc 45


bool octave_sparse_params::instance_ok(void)
{
  ....
  instance = new octave_sparse_params();
  if (instance)
  ....
}

Similar errors can be found in some other places:

  • V668 There is no sense in testing the 'instance' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. oct-rand.cc 96
  • V668 There is no sense in testing the 'instance' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. file-ops.cc 82
  • V668 There is no sense in testing the 'instance' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. mach-info.cc 148
  • And 24 additional diagnostic messages.

Doxygen

V668 There is no sense in testing the 'file' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. outputgen.cpp 47


void OutputGenerator::startPlainFile(const char *name)
{
  ....
  file = new QFile(fileName);
  if (!file)
  ....
}

Similar errors can be found in some other places:

  • V668 There is no sense in testing the 'expr' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. template.cpp 1981
  • V668 There is no sense in testing the 'n' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. qglist.cpp 1005
  • V668 There is no sense in testing the 'nd' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. qstring.cpp 12099

Appleseed

V668 There is no sense in testing the 'result' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. appleseed string.cpp 58


char* duplicate_string(const char* s)
{
  assert(s);

  char* result = new char[strlen(s) + 1];

  if (result)
    strcpy(result, s);

  return result;
}

Firebird

V668 There is no sense in testing the 'xcc' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. xnet.cpp 2533


rem_port* XnetServerEndPoint::get_server_port(....)
{
  ....
  XCC xcc = FB_NEW struct xcc(this);

  try {
    ....
  }
  catch (const Exception&)
  {
    if (port)
      cleanup_port(port);
    else if (xcc)
      cleanup_comm(xcc);

    throw;
  }

  return port;
}

7-Zip

V668 There is no sense in testing the 'plugin' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. far.cpp 399


static HANDLE MyOpenFilePluginW(const wchar_t *name)
{
  ....
  CPlugin *plugin = new CPlugin(
    fullName,
    // defaultName,
    agent,
    (const wchar_t *)archiveType
    );

    if (!plugin)
      return INVALID_HANDLE_VALUE;
    ....
}

Similar errors can be found in some other places:

  • V668 There is no sense in testing the 'm_Formats' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. enumformatetc.cpp 46
  • V668 There is no sense in testing the 'm_States' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. bzip2decoder.cpp 445
  • V668 There is no sense in testing the 'ThreadsInfo' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. bzip2encoder.cpp 170

OpenJDK

V668 There is no sense in testing the '_bigbuf' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. filebuff.cpp 47


FileBuff::FileBuff( BufferedFile *fptr, ArchDesc& archDesc) :
                   _fp(fptr), _AD(archDesc) {
  ....
  _bigbuf = new char[_bufferSize];
  if( !_bigbuf ) {
    file_error(SEMERR, 0, "Buffer allocation failed\n");
    exit(1);
  ....
}

Similar errors can be found in some other places:

  • V668 There is no sense in testing the 'vspace' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. psParallelCompact.cpp 455
  • V668 There is no sense in testing the 'uPtr' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. jni.cpp 113

Inkscape

V668 There is no sense in testing the 'outputBuf' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. gzipstream.cpp 180


bool GzipInputStream::load()
{
  ....
  outputBuf = new unsigned char [OUT_SIZE];
  if ( !outputBuf ) {  // <=
    delete[] srcBuf;
    srcBuf = NULL;
    return false;
  }
  ....
}

Similar errors can be found in some other places:

  • V668 There is no sense in testing the 'destbuf' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. gzipstream.cpp 397
  • V668 There is no sense in testing the 'srcBuf' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. gzipstream.cpp 175
  • V668 There is no sense in testing the 'oldcurve' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. sp-lpe-item.cpp 719

CodeLite

V668 There is no sense in testing the 'buffer' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. ShapeDataObject.cpp 65


wxString wxSFShapeDataObject::SerializeSelectedShapes(....)
{
  ....
  char *buffer = new char [outstream.GetSize()];           // <=

  if(buffer)                                               // <=
  {
    memset(buffer, 0, outstream.GetSize());
    outstream.CopyTo(buffer, outstream.GetSize()-1);
    wxString output(buffer, wxConvUTF8);
    delete [] buffer;
    return output;
  }
  else
    return wxT(....);
}

Similar errors can be found in some other places:

  • V668 There is no sense in testing the 'pResultSet' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. SqliteDatabaseLayer.cpp 199
  • V668 There is no sense in testing the 'pReturnStatement' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. SqliteDatabaseLayer.cpp 223
  • V668 There is no sense in testing the 'm_proc' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. async_executable_cmd.cpp 182

Universal Scene Description

V668 There is no sense in testing the '_rawBuffer' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. uvTextureStorageData.cpp 118


bool GlfUVTextureStorageData::Read(....)
{
  ....
  _rawBuffer = new unsigned char[_size];                   // <=
  if (_rawBuffer == nullptr) {                             // <=
      TF_RUNTIME_ERROR("Unable to allocate buffer.");
      return false;
  }
  ....
}

CMaNGOS

V668 There is no sense in testing the 'pmmerge' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. MapBuilder.cpp 553


void MapBuilder::buildMoveMapTile(....)
{
  ....
  rcPolyMesh** pmmerge =
     new rcPolyMesh*[TILES_PER_MAP * TILES_PER_MAP];

  if (!pmmerge)
  {
    printf("%s alloc pmmerge FIALED! \r", tileString);
    return;
  }
  ....
}

Similar errors can be found in some other places:

  • V668 There is no sense in testing the 'data' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. loadlib.cpp 36
  • V668 There is no sense in testing the 'dmmerge' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. MapBuilder.cpp 560
  • V668 There is no sense in testing the 'm_session' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. WorldSocket.cpp 426

Notepad++

V668 There is no sense in testing the 'source' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. notepad_plus.cpp 1149


void Notepad_plus::wsTabConvert(spaceTab whichWay)
{
  ....
  char * source = new char[docLength];
  if (source == NULL)
    return;
  ....
}

Similar errors can be found in some other places:

  • V668 There is no sense in testing the 'destination' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. notepad_plus.cpp 1170
  • V668 There is no sense in testing the '_pShortcutMapper' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. nppbigswitch.cpp 1340
  • V668 There is no sense in testing the 'mEscCharSetProber' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. nsuniversaldetector.cpp 199
  • And 24 additional diagnostic messages.

Aspell

V668 There is no sense in testing the 'buffer' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. new_fmode.cpp 406


bool FilterMode::MagicString::matchFile(
  FILE * in,const String & ext)
{
  ....
  char * buffer = new char[(position + 1)];

  if ( buffer == NULL ) {
    regfree(&seekMagic);
    rewind(seekIn);
    return false;
  }
  ....
}

Tizen

V668 There is no sense in testing the 'm_buf' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. slm.cpp 97


bool CThreadSlm::load(const char* fname, bool MMap)
{
  int fd = open(fname, O_RDONLY);
  ....
  if ((m_buf = new char[m_bufSize]) == NULL) {
    close(fd);
    return false;
  }
  ....
}

Tizen

V668 There is no sense in testing the 'ieffect' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. w-input-stt-voice.cpp 566


static Eina_Bool _idler_cb(void *data)
{
  ....
  is::ui::WInputSttMicEffect *ieffect =
    new is::ui::WInputSttMicEffect();
  if (ieffect)
    ieffect->SetSttHandle(voicedata->sttmanager->GetSttHandle());
  ....
}

Tizen

V668 There is no sense in testing the 'item_data' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. SettingsAFCreator.cpp 112


void SettingsAFCreator::createNewAutoFillFormItem()
{
  ....
  auto item_data = new AutoFillFormItemData;
  if (!item_data) {
    BROWSER_LOGE("Malloc failed to get item_data");
    return;
  }
  ....
}

Tizen

V668 There is no sense in testing the 'clone' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. maps_util.h 153


template <class T> class vector {
private:
  ....
  void push_back(const T &value)
  {
    T *clone = new T(value);
    if (clone) {
      g_array_append_val(parray, clone);
      current_size++;
    }
  }
  ....
};

Similar errors can be found in some other places:

  • V668 There is no sense in testing the 'ieffect' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. w-input-stt-voice.cpp 573
  • V668 There is no sense in testing the 'cmd' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. maps_service.cpp 312
  • V668 There is no sense in testing the 'cmd' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. maps_service.cpp 348
  • And 47 additional diagnostic messages.

EFL Core Libraries

V668 There is no sense in testing the 'motion_state' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. ephysics_body.cpp 837


static EPhysics_Body *
_ephysics_body_rigid_body_add(....)
{
  ....
  motion_state = new btDefaultMotionState();
  if (!motion_state)
  {
    ERR("Couldn't create a motion state.");
    goto err_motion_state;
  }
  ....
}

EFL Core Libraries

V668 There is no sense in testing the 'constraint->bt_constraint' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. ephysics_constraints.cpp 382


EAPI EPhysics_Constraint *
ephysics_constraint_linked_add(EPhysics_Body *body1,
                               EPhysics_Body *body2)
{
  ....
  constraint->bt_constraint = new btGeneric6DofConstraint(
     *ephysics_body_rigid_body_get(body1),
     *ephysics_body_rigid_body_get(body2),
     btTransform(), btTransform(), false);

  if (!constraint->bt_constraint)
  {
    ephysics_world_lock_release(constraint->world);
    free(constraint);
    return NULL;
  }
  ....
}

Similar errors can be found in some other places:

  • V668 There is no sense in testing the 'rigid_body_ci' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. ephysics_body.cpp 848
  • V668 There is no sense in testing the 'rigid_body' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. ephysics_body.cpp 855
  • V668 There is no sense in testing the 'shape' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. ephysics_body.cpp 2769
  • And 16 additional diagnostic messages.

Rosegarden

V668 There is no sense in testing the 'file' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. SF2PatchExtractor.cpp 94


SF2PatchExtractor::Device
SF2PatchExtractor::read(string fileName)
{
  Device device;

  ifstream *file = new ifstream(fileName.c_str(), ios::in |....);
  if (!file)
    throw FileNotFoundException();
  ....
}

Similar errors can be found in some other places:

  • V668 There is no sense in testing the 'statstream' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. RosegardenMainWindow.cpp 4672
  • V668 There is no sense in testing the 'file' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. SF2PatchExtractor.cpp 67

Chromium

V668 CWE-570 There is no sense in testing the 'buffer' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. harfbuzz_font_skia.cc 229


hb_blob_t* GetFontTable(hb_face_t* face, hb_tag_t tag,
                        void* user_data) {
  ....
  std::unique_ptr<char[]> buffer(new char[table_size]);
  if (!buffer)
    return 0;
  ....
}

A pointless check. The new operator will generate an exception std::bad_alloc, if memory is not be allocated.


Chromium

V668 CWE-570 There is no sense in testing the 'zlib_stream_' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. gzip_source_stream.cc 60


bool GzipSourceStream::Init() {
  zlib_stream_.reset(new z_stream);
  if (!zlib_stream_)
    return false;
  memset(zlib_stream_.get(), 0, sizeof(z_stream));
  ....
}

A pointless check. The new operator will generate an exception std::bad_alloc, if memory is not be allocated.


Chromium

V668 CWE-570 There is no sense in testing the 'blocks_' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. quic_stream_sequencer_buffer.cc 279


bool QuicStreamSequencerBuffer::CopyStreamData(....) {
  ....
    if (blocks_ == nullptr) {
      blocks_.reset(new BufferBlock*[blocks_count_]());     // <=
      for (size_t i = 0; i < blocks_count_; ++i) {
        blocks_[i] = nullptr;                               // <=
      }
    }

    if (write_block_num >= blocks_count_) {
      *error_details = QuicStrCat(
          "QuicStreamSequencerBuffer error: OnStreamData() "
          "exceed array bounds."
          "write offset = ",
          offset, " write_block_num = ", write_block_num,
          " blocks_count_ = ", blocks_count_);
      return false;
    }

    if (blocks_ == nullptr) {                               // <=
      *error_details =
          "QuicStreamSequencerBuffer error: "
          "OnStreamData() blocks_ is null";
      return false;
    }
  ....
}

A pointless check. The new operator will generate an exception std::bad_alloc, if memory is not be allocated. This check looks even more inappropriate when you consider that before it a pointer is already dereferenced: blocks_[i] = nullptr;

Similar errors can be found in some other places:

  • V668 CWE-570 There is no sense in testing the 'translate_thread_' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. pnacl_coordinator.cc 207
  • V668 CWE-570 There is no sense in testing the 'image_shms' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. pepper_compositor_host.cc 367

ANGLE

V668 CWE-570 There is no sense in testing the 'mStreamingBuffer' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. vertexdatamanager.cpp 209


gl::Error VertexDataManager::initialize()
{
  mStreamingBuffer.reset(
    new StreamingVertexBufferInterface(mFactory,
          INITIAL_STREAM_BUFFER_SIZE));
  if (!mStreamingBuffer)
  {
    return gl::OutOfMemory() <<
           "Failed to allocate the streaming vertex buffer.";
  }

  return gl::NoError();
}

A pointless check. The new operator will generate an exception std::bad_alloc, if memory is not allocated.

Similar errors can be found in some other places:

  • V668 CWE-570 There is no sense in testing the 'memory' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. poolalloc.cpp 294
  • V668 CWE-570 There is no sense in testing the 'memory' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. poolalloc.cpp 319

Hunspell

V668 CWE-570 There is no sense in testing the 'iterator' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. affixmgr.cxx 277


int AffixMgr::parse_file(const char* affpath, const char* key) {
  ....
  FileMgr* iterator = new FileMgr(&affix_iterator);
  if (!iterator) {
    HUNSPELL_WARNING(stderr,
      "error: could not create a FileMgr from an "
      "affix line iterator.\n");
    return 1;
  }
  ....
}

A pointless check. The new operator will generate an exception std::bad_alloc, if memory is not allocated.

Similar errors can be found in some other places:

  • V668 CWE-570 There is no sense in testing the 'afflst' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. affixmgr.cxx 297
  • V668 CWE-570 There is no sense in testing the 'afflst' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. hashmgr.cxx 963
  • V668 CWE-570 There is no sense in testing the 'r' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. replist.cxx 163

SwiftShader

V668 CWE-570 There is no sense in testing the 'memory' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. poolalloc.cpp 284


void* TPoolAllocator::allocate(size_t numBytes)
{
  ....
  tHeader* memory =
    reinterpret_cast<tHeader*>(::new char[numBytesToAlloc]);
  if (memory == 0)
    return 0;
  ....
}

A pointless check. The new operator will generate an exception std::bad_alloc, if memory is not allocated.

Similar errors can be found in some other places:

  • V668 CWE-571 There is no sense in testing the 'block' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. memory.cpp 71
  • V668 CWE-570 There is no sense in testing the 'mStreamingBuffer' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. indexdatamanager.cpp 38
  • V668 CWE-570 There is no sense in testing the 'mIndexBuffer' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. indexdatamanager.cpp 383
  • And 6 additional diagnostic messages.

WebRTC

V668 CWE-570 There is no sense in testing the 'aec' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. aec_core.cc 1472


AecCore* WebRtcAec_CreateAec(int instance_count) {
  AecCore* aec = new AecCore(instance_count);

  if (!aec) {
    return NULL;
  }
  ....
}

A pointless check. The new operator will generate an exception std::bad_alloc, if memory is not allocated.

Similar errors can be found in some other places:

  • V668 CWE-570 There is no sense in testing the 'aecpc' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. echo_cancellation.cc 126
  • V668 CWE-570 There is no sense in testing the 'newBuffer' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. i420.cc 65
  • V668 CWE-570 There is no sense in testing the 'pointer' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. externalhmac.cc 79
  • And 4 additional diagnostic messages.

EA WebKit

V668 CWE-571 There is no sense in testing the 'bitmap' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. imagebitmap.cpp 823


void ImageBitmap::ResolvePromiseOnOriginalThread(....)
{
  ....
  ImageBitmap* bitmap = new ImageBitmap(image);
  if (bitmap && bitmap->BitmapImage())
    bitmap->BitmapImage()->SetOriginClean(origin_clean);
  ....
}

A pointless check. The new operator will generate an exception std::bad_alloc, if memory is not allocated.

Similar errors can be found in some other places:

  • V668 CWE-571 There is no sense in testing the 'bitmap' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. imagebitmap.cpp 825
  • V668 CWE-571 There is no sense in testing the 'bitmap' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. imagebitmap.cpp 889
  • V668 CWE-571 There is no sense in testing the 'bitmap' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. imagebitmap.cpp 893
  • And 5 additional diagnostic messages.

Krita

V668 There is no sense in testing the 'charStyle' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. CharacterGeneral.cpp 153


bool KoPathShape::separate(QList<KoPathShape*> & separatedPaths)
{
    ....

    Q_FOREACH (KoSubpath* subpath, d->subpaths) {
        KoPathShape *shape = new KoPathShape();
        if (! shape) continue; // <=
        ....
    }
}

Similar errors can be found in some other places:

  • V668 There is no sense in testing the 'factory' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. TestKoShapeFactory.cpp 36
  • V668 There is no sense in testing the 'parStyle' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. ParagraphGeneral.cpp 199
  • V668 There is no sense in testing the 'spline' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. multi_bspline_create.cpp 460
  • And 1 additional diagnostic messages.

Android

V668 CWE-570 There is no sense in testing the 'buf' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. scan.cpp 213


int parse_apk(const char *path, const char *target_package_name)
{
  ....
  FileMap *dataMap = zip->createEntryFileMap(entry);
  if (dataMap == NULL) {
    ALOGW("%s: failed to create FileMap\n", __FUNCTION__);
    return -1;
  }
  char *buf = new char[uncompLen];
  if (NULL == buf) {
    ALOGW("%s: failed to allocate %" PRIu32 " byte\n",
          __FUNCTION__, uncompLen);
    delete dataMap;
    return -1;
  }
  ....
}

Similar errors can be found in some other places:

  • V668 CWE-570 There is no sense in testing the 'args' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. commandline.cpp 625
  • V668 CWE-571 There is no sense in testing the 'buf' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. logcat.cpp 1564
  • V668 CWE-570 There is no sense in testing the 'cpu' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. rsCpuCore.cpp 54
  • And 172 additional diagnostic messages.

0 A.D.

V668 CWE-570 There is no sense in testing the 'pEvent' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. fsm.cpp 259


CFsmEvent* CFsm::AddEvent( unsigned int eventType )
{
  ....
  pEvent = new CFsmEvent( eventType );
  if ( !pEvent ) return NULL;
  ....
}

0 A.D.

V668 CWE-570 There is no sense in testing the 'pNewTransition' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. fsm.cpp 289


CFsmTransition* CFsm::AddTransition(....)
{
  ....
  CFsmEvent* pEvent = AddEvent( eventType );
  if ( !pEvent ) return NULL;

  // Create new transition
  CFsmTransition* pNewTransition = new CFsmTransition( state );
  if ( !pNewTransition )
  {
    delete pEvent;
    return NULL;
  }
  ....
}

Similar errors can be found in some other places:

  • V668 CWE-571 There is no sense in testing the 'ret' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. TerrainTextureEntry.cpp 120
  • V668 CWE-571 There is no sense in testing the 'answer' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. SoundManager.cpp 542

Qt

V668 CWE-571 There is no sense in testing the 'd->unmapPointer' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. qtranslator.cpp 596


bool QTranslatorPrivate::do_load(const QString &realname,
                                 const QString &directory)
{
  ....
  d->unmapPointer = new char[d->unmapLength];
  if (d->unmapPointer) {
    file.seek(0);
    qint64 readResult = file.read(d->unmapPointer, d->unmapLength);
    if (readResult == qint64(unmapLength))
      ok = true;
  }
  ....
}

Similar errors can be found in some other places:

  • V668 CWE-571 There is no sense in testing the 'data' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. qresource.cpp 1050
  • V668 CWE-571 There is no sense in testing the 'cacheItem->file' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. qnetworkdiskcache.cpp 292
  • V668 CWE-571 There is no sense in testing the 'buf' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. qhttpthreaddelegate.cpp 624
  • And 8 additional diagnostic messages.

LibreOffice

V668 There is no sense in testing the 'm_pStream' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. zipfile.cxx 408


ZipFile::ZipFile(const std::wstring &FileName) :
    m_pStream(nullptr),
    m_bShouldFree(true)
{
    m_pStream = new FileStream(FileName.c_str());
    if (m_pStream && !isZipStream(m_pStream))
    {
        delete m_pStream;
        m_pStream = nullptr;
    }
}

SpeedCrunch

V668 There is no sense in testing the 'item' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. editor.cpp 998


void EditorCompletion::showCompletion(const QStringList& choices)
{
  ....
  for (int i = 0; i < choices.count(); ++i) {
    QStringList pair = choices.at(i).split(':');
    QTreeWidgetItem* item = new QTreeWidgetItem(m_popup, pair);

    if (item && m_editor->layoutDirection() == Qt::RightToLeft)
        item->setTextAlignment(0, Qt::AlignRight);
    ....
  }
  ....
}

Celestia

V668 There is no sense in testing the 'dp' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. windatepicker.cpp 625


static LRESULT
DatePickerCreate(HWND hwnd, CREATESTRUCT& cs)
{
  DatePicker* dp = new DatePicker(hwnd, cs);
  if (dp == NULL)
    return -1;
  ....
}

Similar errors can be found in some other places:

  • V668 There is no sense in testing the 'modes' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. winmain.cpp 2967
  • V668 There is no sense in testing the 'dropTarget' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. winmain.cpp 3272
  • V668 There is no sense in testing the 'appCore' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. winmain.cpp 3352

TON

V668 There is no sense in testing the 'c' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. CellBuilder.cpp 531


CellBuilder* CellBuilder::make_copy() const {
  CellBuilder* c = new CellBuilder();
  if (!c) { // <=
    throw CellWriteError();
  }
  ....
}

Newton Game Dynamics

V668 There is no sense in testing the 'pBits' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. TargaToOpenGl.cpp 166


char* const pBits = new char [width * height * 4];
if(pBits == NULL)
{
  fclose(pFile);
  return 0;
}

Minetest

V668 There is no sense in testing the 'clouds' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. game.cpp 1367


bool Game::createClient(....)
{
  if (m_cache_enable_clouds) {
    clouds = new Clouds(smgr, -1, time(0));
    if (!clouds) {
      *error_message = "Memory allocation error (clouds)";
      errorstream << *error_message << std::endl;
      return false;
    }
  }
}

Qt

V668 [CWE-570] There is no sense in testing the 'isi' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. qimagescale.cpp 245


static QImageScaleInfo* QImageScale::qimageCalcScaleInfo(....)
{
  ....
  QImageScaleInfo *isi;
  ....
  isi = new QImageScaleInfo;
  if (!isi)
    return nullptr;
  ....
}

Similar errors can be found in some other places:

  • V668 [CWE-571] There is no sense in testing the 'buf' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. qhttpthreaddelegate.cpp 620
  • V668 [CWE-571] There is no sense in testing the 'cacheItem->file' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. qnetworkdiskcache.cpp 292
  • V668 [CWE-571] There is no sense in testing the 'image->pix' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. qquickstyledtext.cpp 710

SystemC

V668 There is no sense in testing the 'items' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. sc_report_handler.cpp 471


sc_msg_def * sc_report_handler::add_msg_type(const char * msg_type_)
{
  ....
  msg_def_items * items = new msg_def_items;

  if ( !items )
    return 0;
  ....
}

Similar errors can be found in some other places:

  • V668 There is no sense in testing the 'items->md' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. sc_report_handler.cpp 477

RPCS3

V668 There is no sense in testing the 'movie' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. movie_item.h 56


void init_movie(const QString& path)
{
  if (path.isEmpty() || !m_icon_callback) return;

  if (QMovie* movie = new QMovie(path); movie && movie->isValid())
  {
    m_movie = movie;
  }
  else
  {
    delete movie;
    return;
  }

  QObject::connect(m_movie, &QMovie::frameChanged, m_movie, m_icon_callback);
}

Similar errors can be found in some other places:

  • V668 There is no sense in testing the 'm_render_creator' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. emu_settings.cpp 75
  • V668 There is no sense in testing the 'trophy_slider_label' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. trophy_manager_dialog.cpp 216

MuditaOS

V668 [CERT-MEM52-CPP] There is no sense in testing the 'pcBuffer' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. syscalls_stdio.cpp 384


int _iosys_fprintf(FILE *__restrict __stream,
                  const char *__restrict __format, ...)
{
  constexpr auto buf_len = 4096;
  char *pcBuffer;
  ....
  pcBuffer = new char[buf_len];
  if (pcBuffer == NULL)
  {
    ....
  }
}

Similar errors can be found in some other places:

  • V668 [CERT-MEM52-CPP] There is no sense in testing the 'fontData' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. FontManager.cpp 56
  • V668 [CERT-MEM52-CPP] There is no sense in testing the 'data' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. ImageManager.cpp 85
  • V668 [CERT-MEM52-CPP] There is no sense in testing the 'data' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. ImageManager.cpp 131

CodeLite

V668 There is no sense in testing the 'pDump' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. ErdCommitWizard.cpp:220


void BackupPage::OnBtnBackupClick(wxCommandEvent& event)
{
  ....
  DumpClass* pDump = new DumpClass(....);
  if (pDump) dumpResult = pDump->DumpData();
  ....
}

Similar errors can be found in some other places:

  • V668 There is no sense in testing the 'pLabel' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. ErdForeignKey.cpp:42
  • V668 There is no sense in testing the 'pBitmap' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. ErdTable.cpp:244
  • V668 There is no sense in testing the 'm_pLabel' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. ErdView.cpp:100
  • And 7 additional diagnostic messages.