From 5b27e129e1fdbbb7f99cc7ed9d9d211010b4cee9 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Thu, 1 Apr 2010 16:24:15 +0200 Subject: Fix a couple of memory bugs --- src/cell.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/cell.c') diff --git a/src/cell.c b/src/cell.c index b541a24c..e3b069bd 100644 --- a/src/cell.c +++ b/src/cell.c @@ -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); -- cgit v1.2.3