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.
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 '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 '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 '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;
}
....
}
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;
}
....
}
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;
}
....
}
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 '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;
....
}
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;
}
....
}
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 '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 '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 '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. :)
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 '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 '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 '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 '_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 '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;
}
....
}
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;
....
}
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;
}
....
}
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 '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 '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 '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 '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 '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 '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 '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 '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 '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 '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 '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 '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;
}
....
}
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 '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 '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 '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 '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 '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 '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 '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;
}
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 '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 '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 '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 '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 '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 '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;
}
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;
}
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 '_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 '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 '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 '_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;
}
....
}
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 '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 '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;
}
....
}
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;
}
....
}
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());
....
}
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;
}
....
}
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 '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;
}
....
}
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 '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 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.
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.
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 '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 '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 '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-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-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 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 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 '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;
....
}
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 '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 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;
}
}
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);
....
}
....
}
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 '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();
}
....
}