Examples of errors detected by the V668 diagnostic.


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


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

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


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;
  }
  ....
}

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 207 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

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


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 '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
  • 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. d3dx9math.inl 995
  • 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. d3dx9math.inl 1010
  • And 2 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 9 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 608
  • 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
  • And 79 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.


Do you make errors in the code?

Check your code
with PVS-Studio

Static code analysis
for C, C++ and C#

goto PVS-Studio;