Commit dcdc5ea1 authored by Thomas White's avatar Thomas White
Browse files

Fix memory leaks

parent afd85c7d
......@@ -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;
}
......@@ -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++ ) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment