aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/index.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/index.c b/src/index.c
index eef85d52..ce6021da 100644
--- a/src/index.c
+++ b/src/index.c
@@ -210,14 +210,20 @@ void index_pattern(struct image *image, UnitCell *cell, IndexingMethod *indm,
}
image->indexed_cell = new_cell;
+ goto done; /* Success */
}
+ for ( i=0; i<image->ncells; i++ ) {
+ cell_free(image->candidate_cells[i]);
+ }
+
/* Move on to the next indexing method */
n++;
}
+done:
for ( i=0; i<image->ncells; i++ ) {
cell_free(image->candidate_cells[i]);
}