biod.pnpi.spb.ru
/
alexxy
/
gromacs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fddbc9b
)
Fixed Bug #593 about memory hole in trjcat.
author
David van der Spoel
<spoel@xray.bmc.uu.se>
Sun, 21 Oct 2012 10:06:32 +0000
(12:06 +0200)
committer
David van der Spoel
<spoel@xray.bmc.uu.se>
Sun, 21 Oct 2012 10:06:32 +0000
(12:06 +0200)
Fixed by explicitly freeing memory for each frame. Tested to make
sure it does not crash.
Change-Id: Ic0e91b828a1e5a23f38690b4753092a31e6c4db4
src/tools/gmx_trjcat.c
patch
|
blob
|
history
diff --git
a/src/tools/gmx_trjcat.c
b/src/tools/gmx_trjcat.c
index 3f5296a14150c51d51af22cb923dfc05f026f8e3..63f2b8fbe517f28f351c08fbb62888fb183fe427 100644
(file)
--- a/
src/tools/gmx_trjcat.c
+++ b/
src/tools/gmx_trjcat.c
@@
-128,10
+128,15
@@
static void scan_trj_files(char **fnms, int nfiles, real *readtime,
}
close_trj(status);
+ if (fr.bX)
+ sfree(fr.x);
+ if (fr.bV)
+ sfree(fr.v);
+ if (fr.bF)
+ sfree(fr.f);
}
fprintf(stderr,"\n");
- sfree(fr.x);
}
static void sort_files(char **fnms, real *settime, int nfile)