Patch #507 » cppcheckfixes.diff
dcmdata/libsrc/mkdictbi.cc | ||
---|---|---|
fprintf(fout, "\n");
|
||
|
||
dcmDataDict.unlock();
|
||
if (filename && fout)
|
||
{
|
||
fclose(fout);
|
||
}
|
||
return 0;
|
||
}
|
dcmnet/libsrc/assoc.cc | ||
---|---|---|
pc = (DUL_PRESENTATIONCONTEXT *) calloc(1, sizeof(DUL_PRESENTATIONCONTEXT));
|
||
if (pc == NULL) return EC_MemoryExhausted;
|
||
lst = LST_Create();
|
||
if (lst == NULL) return EC_MemoryExhausted;
|
||
if (lst == NULL)
|
||
{
|
||
free(pc);
|
||
return EC_MemoryExhausted;
|
||
}
|
||
pc->presentationContextID = presentationContextID;
|
||
strcpy(pc->abstractSyntax, abstractSyntax);
|
||
pc->result = ASC_P_NOTYETNEGOTIATED;
|
dcmpstat/apps/dcmmkcrv.cc | ||
---|---|---|
||(!curveDescription)||(!axisUnits)||(!curveLabel))
|
||
{
|
||
OFLOG_FATAL(dcmmkcrvLogger, "out of memory");
|
||
delete [] array;
|
||
return 1;
|
||
}
|
||
|
||
... | ... | |
case 0: // US
|
||
OFLOG_INFO(dcmmkcrvLogger, "creating curve, VR=US, points=" << idx/2);
|
||
rawData = new Uint16[idx];
|
||
if (rawData==NULL) { OFLOG_FATAL(dcmmkcrvLogger, "out of memory"); return 1; }
|
||
if (rawData==NULL) { OFLOG_FATAL(dcmmkcrvLogger, "out of memory"); delete [] array; return 1; }
|
||
byteLength = sizeof(Uint16)*idx;
|
||
for (i=0; i<idx; i++) OFstatic_cast(Uint16 *,rawData)[i] = OFstatic_cast(Uint16,array[i]);
|
||
align = sizeof(Uint16);
|
||
... | ... | |
case 1: // SS
|
||
OFLOG_INFO(dcmmkcrvLogger, "creating curve, VR=SS, points=" << idx/2);
|
||
rawData = new Sint16[idx];
|
||
if (rawData==NULL) { OFLOG_FATAL(dcmmkcrvLogger, "out of memory"); return 1; }
|
||
if (rawData==NULL) { OFLOG_FATAL(dcmmkcrvLogger, "out of memory"); delete [] array; return 1; }
|
||
byteLength = sizeof(Sint16)*idx;
|
||
for (i=0; i<idx; i++) OFstatic_cast(Sint16 *,rawData)[i] = OFstatic_cast(Sint16,array[i]);
|
||
align = sizeof(Sint16);
|
||
... | ... | |
case 2: // FL
|
||
OFLOG_INFO(dcmmkcrvLogger, "creating curve, VR=FL, points=" << idx/2);
|
||
rawData = new Float32[idx];
|
||
if (rawData==NULL) { OFLOG_FATAL(dcmmkcrvLogger, "out of memory"); return 1; }
|
||
if (rawData==NULL) { OFLOG_FATAL(dcmmkcrvLogger, "out of memory"); delete [] array; return 1; }
|
||
byteLength = sizeof(Float32)*idx;
|
||
for (i=0; i<idx; i++) OFstatic_cast(Float32 *,rawData)[i] = OFstatic_cast(Float32,array[i]);
|
||
align = sizeof(Float32);
|
||
... | ... | |
case 3: // FD
|
||
OFLOG_INFO(dcmmkcrvLogger, "creating curve, VR=FD, points=" << idx/2);
|
||
rawData = new Float64[idx];
|
||
if (rawData==NULL) { OFLOG_FATAL(dcmmkcrvLogger, "out of memory"); return 1; }
|
||
if (rawData==NULL) { OFLOG_FATAL(dcmmkcrvLogger, "out of memory"); delete [] array; return 1; }
|
||
byteLength = sizeof(Float64)*idx;
|
||
for (i=0; i<idx; i++) OFstatic_cast(Float64 *,rawData)[i] = OFstatic_cast(Float64,array[i]);
|
||
align = sizeof(Float64);
|
||
... | ... | |
case 4: // SL
|
||
OFLOG_INFO(dcmmkcrvLogger, "creating curve, VR=SL, points=" << idx/2);
|
||
rawData = new Sint32[idx];
|
||
if (rawData==NULL) { OFLOG_FATAL(dcmmkcrvLogger, "out of memory"); return 1; }
|
||
if (rawData==NULL) { OFLOG_FATAL(dcmmkcrvLogger, "out of memory"); delete [] array; return 1; }
|
||
byteLength = sizeof(Sint32)*idx;
|
||
for (i=0; i<idx; i++) OFstatic_cast(Sint32 *,rawData)[i] = OFstatic_cast(Sint32,array[i]);
|
||
align = sizeof(Sint32);
|
||
break;
|
||
default:
|
||
OFLOG_FATAL(dcmmkcrvLogger, "unknown data VR, bailing out");
|
||
delete [] array;
|
||
return 1;
|
||
}
|
||
delete [] array;
|
||
|
||
DcmElement *element = NULL;
|
||
switch (opt_curve_vr)
|
oflog/libsrc/striconv.cc | ||
---|---|---|
STD_NAMESPACE ostringstream oss;
|
||
oss << "iconv_close failed: " << errno;
|
||
STD_NAMESPACE cerr << oss.str () << OFendl;
|
||
throw STD_NAMESPACE runtime_error (oss.str ().c_str ());
|
||
}
|
||
}
|
||
}
|