Commit 5b27e129 authored by Thomas White's avatar Thomas White
Browse files

Fix a couple of memory bugs

parent fced9d2b
......@@ -350,7 +350,6 @@ int cell_get_reciprocal(UnitCell *cell,
gsl_matrix_set(m, 2, 1, cell->bz);
gsl_matrix_set(m, 2, 2, cell->cz);
/* Invert */
/* Invert */
perm = gsl_permutation_alloc(m->size1);
if ( perm == NULL ) {
......@@ -381,6 +380,8 @@ int cell_get_reciprocal(UnitCell *cell,
free(cell);
return -1;
}
gsl_permutation_free(perm);
gsl_matrix_free(m);
/* Transpose */
gsl_matrix_transpose(inv);
......
......@@ -327,9 +327,6 @@ static void *process_image(void *pargsv)
/* Only free cell if found */
free(image.indexed_cell);
/* Free detector panel records */
free(image.det.panels);
done:
free(image.data);
free(image.det.panels);
......@@ -477,7 +474,7 @@ int main(int argc, char *argv[])
}
if ( prefix == NULL ) {
prefix = "";
prefix = strdup("");
}
if ( nthreads == 0 ) {
......
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