Index: /issm/trunk/src/c/objects/Bamg/Geometry.cpp
===================================================================
--- /issm/trunk/src/c/objects/Bamg/Geometry.cpp	(revision 9308)
+++ /issm/trunk/src/c/objects/Bamg/Geometry.cpp	(revision 9309)
@@ -606,5 +606,10 @@
 			double lv10=Norme2(v10);
 			//check that its length is not 0
-			if(lv10==0)_error_("Length of edge %i is 0",i);
+			if(lv10==0){
+				delete [] next_p;
+				delete [] head_v;
+				delete [] eangle;
+				_error_("Length of edge %i is 0",i);
+			}
 			//compute angle in [-Pi Pi]
 			eangle[i] = atan2(v10.y,v10.x);
Index: /issm/trunk/src/c/objects/Bamg/Mesh.cpp
===================================================================
--- /issm/trunk/src/c/objects/Bamg/Mesh.cpp	(revision 9308)
+++ /issm/trunk/src/c/objects/Bamg/Mesh.cpp	(revision 9309)
@@ -122,4 +122,5 @@
 				int i2 = Tho.GetId(t[2]);
 				if (i0<0 || i1<0 || i2<0){
+					delete [] refv;
 					_error_("i0<0 || i1<0 || i2< 0");
 				}
@@ -1546,4 +1547,5 @@
 		//check that we have been through all subdomains
 		if (k!= nbsubdomains){
+			delete [] colorT;
 			_error_("k!= nbsubdomains");
 		}
@@ -1659,4 +1661,5 @@
 			if (k != i){
 				delete [] len;
+				delete [] colorV;
 				_error_("problem in Edge4 construction: k != i");
 			}
@@ -5319,5 +5322,8 @@
 			}
 		} 
-		if (bfind!=Gh.nbcurves) _error_("problem generating number of curves (%i found in the geometry but %i curve found in the mesh)",Gh.nbcurves,bfind);
+		if (bfind!=Gh.nbcurves){
+			delete [] bcurve;
+			_error_("problem generating number of curves (%i found in the geometry but %i curve found in the mesh)",Gh.nbcurves,bfind);
+		}
 
 		// method in 2 + 1 step 
