[cgma-dev] r1827 - cgm/trunk/geom/OCC

kraftche at mcs.anl.gov kraftche at mcs.anl.gov
Tue May 20 10:01:15 CDT 2008


Author: kraftche
Date: 2008-05-20 10:01:14 -0500 (Tue, 20 May 2008)
New Revision: 1827

Modified:
   cgm/trunk/geom/OCC/OCCQueryEngine.cpp
Log:
fix write off end of array, and memory leak

Modified: cgm/trunk/geom/OCC/OCCQueryEngine.cpp
===================================================================
--- cgm/trunk/geom/OCC/OCCQueryEngine.cpp	2008-05-19 22:04:18 UTC (rev 1826)
+++ cgm/trunk/geom/OCC/OCCQueryEngine.cpp	2008-05-20 15:01:14 UTC (rev 1827)
@@ -1000,10 +1000,7 @@
       B.Add(Co, *vertex);
     }
  
-  char* file = new char[sizeof(file_name)];
-  strcpy(file, file_name);
-  
-  if(!BRepTools::Write(Co, file))
+  if(!BRepTools::Write(Co, const_cast<char*>(file_name)))
     return CUBIT_FAILURE;
  
   return CUBIT_SUCCESS;




More information about the cgma-dev mailing list