]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
21948: EDF SMESH : Memory is not freed when deleting a mesh
authoreap <eap@opencascade.com>
Fri, 14 Dec 2012 12:16:42 +0000 (12:16 +0000)
committereap <eap@opencascade.com>
Fri, 14 Dec 2012 12:16:42 +0000 (12:16 +0000)
+  delete [] aBuffer;

src/HDFPersist/HDFascii.cc

index c8fd3acfdb82ca52f7ab7246f8b8430656c7a4c0..e660f73d03b3d42f25e4d1571491edcb53300b09 100644 (file)
@@ -92,9 +92,11 @@ bool HDFascii::isASCII(const char* thePath) {
   read(fd, aBuffer, 8); 
   close(fd);
 
-  if(strcmp(aBuffer, ASCIIHDF_ID) == 0) return true;
+  bool res = (strcmp(aBuffer, ASCIIHDF_ID) == 0);
 
-  return false;
+  delete [] aBuffer;
+
+  return res;
 }
 
 //############################## HDF => ASCII ################################