Commit 734729b0 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

avoid small memory leak with USER-REAXC + USER-OMP, spotted by GCC's address sanitizer

parent 69d97fa6
Loading
Loading
Loading
Loading
+5 −8
Original line number Diff line number Diff line
@@ -199,8 +199,7 @@ void DeAllocate_Workspace( control_params *control, storage *workspace )
  if (workspace->CdDeltaReduction) sfree( workspace->CdDeltaReduction, "cddelta_reduce" );
  if (workspace->forceReduction) sfree( workspace->forceReduction, "f_reduce" );
  if (workspace->valence_angle_atom_myoffset) sfree( workspace->valence_angle_atom_myoffset, "valence_angle_atom_myoffset");

  if (control->virial && workspace->my_ext_pressReduction) sfree( workspace->my_ext_pressReduction, "ext_press_reduce");
  if (workspace->my_ext_pressReduction) sfree( workspace->my_ext_pressReduction, "ext_press_reduce");
#endif
}

@@ -307,8 +306,6 @@ int Allocate_Workspace( reax_system *system, control_params *control,
					       "forceReduction", comm);

  workspace->valence_angle_atom_myoffset = (int *) scalloc(sizeof(int), total_cap, "valence_angle_atom_myoffset", comm);

  if (control->virial)
  workspace->my_ext_pressReduction = (rvec *) calloc(sizeof(rvec), control->nthreads);
#endif