aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2010-07-13 14:28:46 +0200
committerThomas White <taw@physics.org>2012-02-22 15:26:53 +0100
commitdcdc5ea10c6525434bb2058fbc09e0159c8fcba5 (patch)
treef64fa7aeebaac15cc9ca0432c0b4c3061cec2d87
parentafd85c7d4bc86ffcb27ab13abcd42df0087eefd0 (diff)
Fix memory leaks
-rw-r--r--src/process_hkl.c9
-rw-r--r--src/symmetry.c3
2 files changed, 9 insertions, 3 deletions
diff --git a/src/process_hkl.c b/src/process_hkl.c
index 10dd9f79..a992c2be 100644
--- a/src/process_hkl.c
+++ b/src/process_hkl.c
@@ -344,10 +344,12 @@ int main(int argc, char *argv[])
model = new_list_intensity();
model_counts = new_list_count();
- cell = load_cell_from_pdb(pdb);
new_pattern = new_list_intensity();
items = new_items();
+ cell = load_cell_from_pdb(pdb);
+ free(pdb);
+
if ( strcmp(filename, "-") == 0 ) {
fh = stdin;
} else {
@@ -475,6 +477,11 @@ int main(int argc, char *argv[])
delete_items(items);
free(sym);
+ free(model);
+ free(model_counts);
+ free(new_pattern);
+ free(output);
+ free(cell);
return 0;
}
diff --git a/src/symmetry.c b/src/symmetry.c
index b29af3d4..bca06b48 100644
--- a/src/symmetry.c
+++ b/src/symmetry.c
@@ -164,14 +164,13 @@ static int special_position(signed int hs, signed int ks, signed int ls,
ReflItemList *equivs;
int n_equivs = 0;
- equivs = new_items();
-
if ( idx == 0 ) {
/* Index zero is always the original reflection */
*hp = hs; *kp = ks; *lp = ls;
return 0;
}
+ equivs = new_items();
n_general = num_general_equivs(sym);
for ( i=0; i<n_general; i++ ) {