From: eap Date: Fri, 6 Feb 2009 07:12:21 +0000 (+0000) Subject: Mismatched delete / delete [] X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=7906850e31f5e774c0b465248dd52a88f6b902c1;p=modules%2Fkernel.git Mismatched delete / delete [] --- diff --git a/src/HDFPersist/HDFascii.cc b/src/HDFPersist/HDFascii.cc index 2498319d6..b8247fb8d 100644 --- a/src/HDFPersist/HDFascii.cc +++ b/src/HDFPersist/HDFascii.cc @@ -187,12 +187,12 @@ void SaveGroupInASCIIfile(HDFgroup *hdf_group, FILE* fp, int ident) char* name = makeName(hdf_group->GetName()); fprintf(fp, "%s %i\n", name, nbsons+nbAttr); - delete name; + delete [] name; for(unsigned j=0; jGetAttributeName(j); HDFattribute *hdf_attribute = new HDFattribute(name, hdf_group); - delete name; + delete [] name; SaveAttributeInASCIIfile(hdf_attribute, fp, ident+1); hdf_attribute = 0; } @@ -241,7 +241,7 @@ void SaveDatasetInASCIIfile(HDFdataset *hdf_dataset, FILE* fp, int ident) fprintf(fp, "%s\n", DATASET_ID); fprintf(fp, "%s %i %i\n", name, type, nbAttr); - delete name; + delete [] name; hdf_dataset->GetDim(dim); fprintf(fp, " %i\n", ndim); @@ -251,7 +251,7 @@ void SaveDatasetInASCIIfile(HDFdataset *hdf_dataset, FILE* fp, int ident) } fprintf(fp, "\n"); - delete dim; + delete [] dim; fprintf(fp, "%li %i:", size, order); @@ -259,7 +259,7 @@ void SaveDatasetInASCIIfile(HDFdataset *hdf_dataset, FILE* fp, int ident) char* val = new char[size]; hdf_dataset->ReadFromDisk(val); fwrite(val, 1, size, fp); - delete val; + delete [] val; } else if (type == HDF_FLOAT64) { hdf_float64* val = new hdf_float64[size]; hdf_dataset->ReadFromDisk(val); @@ -272,7 +272,7 @@ void SaveDatasetInASCIIfile(HDFdataset *hdf_dataset, FILE* fp, int ident) } else fprintf(fp," "); } - delete val; + delete [] val; } else if(type == HDF_INT64) { hdf_int64* val = new hdf_int64[size]; hdf_dataset->ReadFromDisk(val); @@ -296,7 +296,7 @@ void SaveDatasetInASCIIfile(HDFdataset *hdf_dataset, FILE* fp, int ident) j = 0; } } - delete val; + delete [] val; } fprintf(fp, "\n"); @@ -305,7 +305,7 @@ void SaveDatasetInASCIIfile(HDFdataset *hdf_dataset, FILE* fp, int ident) { name = hdf_dataset->GetAttributeName(j); HDFattribute *hdf_attribute = new HDFattribute(name, hdf_dataset); - delete name; + delete [] name; SaveAttributeInASCIIfile(hdf_attribute, fp, ident+1); hdf_attribute = 0; } @@ -332,7 +332,7 @@ void SaveAttributeInASCIIfile(HDFattribute *hdf_attribute, FILE* fp, int ident) fprintf(fp, "%s\n", ATTRIBUTE_ID); fprintf(fp, "%s %i %i\n", name, type, size); - delete name; + delete [] name; if (type == HDF_STRING) { char* val = new char[size+1]; @@ -340,7 +340,7 @@ void SaveAttributeInASCIIfile(HDFattribute *hdf_attribute, FILE* fp, int ident) fprintf(fp, ":"); fwrite(val, 1, size, fp); fprintf(fp, "\n"); - delete val; + delete [] val; } else if (type == HDF_FLOAT64) { hdf_float64 val; hdf_attribute->ReadFromDisk(&val);