diff --git a/examples/COUPLE/plugin/simple.c b/examples/COUPLE/plugin/simple.c index 535086f7ad..9151f92848 100644 --- a/examples/COUPLE/plugin/simple.c +++ b/examples/COUPLE/plugin/simple.c @@ -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 */ diff --git a/examples/COUPLE/simple/simple.c b/examples/COUPLE/simple/simple.c index 603ff270b7..096460a3ae 100644 --- a/examples/COUPLE/simple/simple.c +++ b/examples/COUPLE/simple/simple.c @@ -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 */ diff --git a/examples/COUPLE/simple/simple.cpp b/examples/COUPLE/simple/simple.cpp index c05266975e..f17a9d17da 100644 --- a/examples/COUPLE/simple/simple.cpp +++ b/examples/COUPLE/simple/simple.cpp @@ -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