aboutsummaryrefslogtreecommitdiff
path: root/src/cell.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2010-04-01 16:24:15 +0200
committerThomas White <taw@physics.org>2010-04-01 16:24:15 +0200
commit5b27e129e1fdbbb7f99cc7ed9d9d211010b4cee9 (patch)
treea69b581f3babec6d2edf2be68de5618f01a4b52c /src/cell.c
parentfced9d2b5b9154205886e12b5cde73292db3b59d (diff)
Fix a couple of memory bugs
Diffstat (limited to 'src/cell.c')
-rw-r--r--src/cell.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/cell.c b/src/cell.c
index b541a24c..e3b069bd 100644
--- a/src/cell.c
+++ b/src/cell.c
@@ -351,7 +351,6 @@ int cell_get_reciprocal(UnitCell *cell,
gsl_matrix_set(m, 2, 2, cell->cz);
/* Invert */
- /* Invert */
perm = gsl_permutation_alloc(m->size1);
if ( perm == NULL ) {
ERROR("Couldn't allocate permutation\n");
@@ -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);