From 211e7170e4550b3bc3723f61df934aba52649020 Mon Sep 17 00:00:00 2001 From: Thorsten Liebig Date: Mon, 29 Oct 2012 14:51:02 +0100 Subject: [PATCH] critical bug fix: access after delete Signed-off-by: Thorsten Liebig --- FDTD/operator_cylinder.cpp | 2 +- FDTD/operator_cylindermultigrid.cpp | 2 +- FDTD/operator_mpi.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/FDTD/operator_cylinder.cpp b/FDTD/operator_cylinder.cpp index 87f7c60..938e433 100644 --- a/FDTD/operator_cylinder.cpp +++ b/FDTD/operator_cylinder.cpp @@ -310,7 +310,7 @@ void Operator_Cylinder::AddExtension(Operator_Extension* op_ext) Operator_Multithread::AddExtension(op_ext); else { - delete op_ext; cerr << "Operator_Cylinder::AddExtension: Warning: Operator extension \"" << op_ext->GetExtensionName() << "\" is not compatible with cylinder-coords!! skipping...!" << endl; + delete op_ext; } } diff --git a/FDTD/operator_cylindermultigrid.cpp b/FDTD/operator_cylindermultigrid.cpp index f4f92c5..bd1066d 100644 --- a/FDTD/operator_cylindermultigrid.cpp +++ b/FDTD/operator_cylindermultigrid.cpp @@ -498,8 +498,8 @@ void Operator_CylinderMultiGrid::AddExtension(Operator_Extension* op_ext) //check whether extension is save to use in multi-grid if (op_ext->IsCylindricalMultiGridSave(false)==false) { - delete op_ext; cerr << "Operator_CylinderMultiGrid::AddExtension: Warning: Operator extension \"" << op_ext->GetExtensionName() << "\" is not compatible with cylindrical multi-grids!! skipping...!" << endl; + delete op_ext; return; } diff --git a/FDTD/operator_mpi.cpp b/FDTD/operator_mpi.cpp index 12486e4..8aeeb0b 100644 --- a/FDTD/operator_mpi.cpp +++ b/FDTD/operator_mpi.cpp @@ -173,8 +173,8 @@ void Operator_MPI::AddExtension(Operator_Extension* op_ext) Operator_SSE_Compressed::AddExtension(op_ext); else { - delete op_ext; cerr << "Operator_MPI::AddExtension: Warning: Operator extension \"" << op_ext->GetExtensionName() << "\" is not compatible with MPI!! skipping...!" << endl; + delete op_ext; } }