Commit 77846eb6 authored by Giovanni La Mura's avatar Giovanni La Mura
Browse files

Correct valgrind memory leaks

parent d5bb62ce
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -856,6 +856,7 @@ ScattererConfiguration* ScattererConfiguration::from_hdf5(const std::string& fil
    } // di loop
    delete[] elements;
    status = hdf_file->close();
    delete hdf_file;
    conf = new ScattererConfiguration(
				      nsph,
				      configuration_count,
@@ -873,8 +874,8 @@ ScattererConfiguration* ScattererConfiguration::from_hdf5(const std::string& fil
				      _wp,
				      _xip
    );
    delete[] xi_vec;
  }
  
  return conf;
}

+3 −0
Original line number Diff line number Diff line
@@ -326,15 +326,18 @@ void lffft(string data_file, string output_path) {
		if (is != 2222) {
		  if (is != 1111) {
		    if (is > 0) { // Goes to 305
		      if (ac) delete[] ac;
		      ac = new dcomplex[cil->nlemt]();
		      camp(ac, am0m, ws, cil);
		      // Goes to 445
		    } else if (is < 0) { // Goes to 405
		      if (ac) delete[] ac;
		      ac = new dcomplex[cil->nlemt]();
		      czamp(ac, amd, indam, ws, cil);
		      // Goes to 445
		    }
		  } else {
		    if (ac) delete[] ac;
		    ac = new dcomplex[cil->nlemt]();
		    samp(ac, tmsm, tmse, ws, cil);
		    // Goes to 445