plug memory leaks in couple examples

This commit is contained in:
Axel Kohlmeyer
2023-01-25 21:48:29 -05:00
parent 015fa4cb0a
commit db61bf609b
3 changed files with 3 additions and 0 deletions

View File

@ -148,6 +148,7 @@ int main(int narg, char **arg)
double *fx = (double *) plugin->extract_variable(lmp,"fx",(char *)"all");
printf("Force on 1 atom via extract_variable: %g\n",fx[0]);
plugin->free(fx);
}
/* use commands_string() and commands_list() to invoke more commands */

View File

@ -121,6 +121,7 @@ int main(int narg, char **arg)
double *fx = (double *) lammps_extract_variable(lmp,"fx","all");
printf("Force on 1 atom via extract_variable: %g\n",fx[0]);
lammps_free(fx);
}
/* use commands_string() and commands_list() to invoke more commands */

View File

@ -131,6 +131,7 @@ int main(int narg, char **arg)
double *fx = (double *)
lammps_extract_variable(lmp,(char *) "fx",(char *) "all");
printf("Force on 1 atom via extract_variable: %g\n",fx[0]);
lammps_free(fx);
}
// use commands_string() and commands_list() to invoke more commands