From 5a397b385b52f2379ab605797ce2b9fb4ea1d534 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Mon, 16 Jun 2014 17:28:49 +0200 Subject: Fix memory leaks --- src/whirligig.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/whirligig.c b/src/whirligig.c index ed25e887..23a1060d 100644 --- a/src/whirligig.c +++ b/src/whirligig.c @@ -59,13 +59,12 @@ static int cells_are_similar(UnitCell *cell1, UnitCell *cell2) { double asx1, asy1, asz1, bsx1, bsy1, bsz1, csx1, csy1, csz1; double asx2, asy2, asz2, bsx2, bsy2, bsz2, csx2, csy2, csz2; - UnitCellTransformation *tfn1, *tfn2; UnitCell *pcell1, *pcell2; const double atl = deg2rad(5.0); /* Compare primitive cells, not centered */ - pcell1 = uncenter_cell(cell1, &tfn1); - pcell2 = uncenter_cell(cell2, &tfn2); + pcell1 = uncenter_cell(cell1, NULL); + pcell2 = uncenter_cell(cell2, NULL); cell_get_reciprocal(pcell1, &asx1, &asy1, &asz1, &bsx1, &bsy1, &bsz1, @@ -122,6 +121,8 @@ static int gatinator(UnitCell *a, UnitCell *b, IntegerMatrix **pmb) if ( cells_are_similar(a, nc) ) { *pmb = m; + tfn_free(tfn); + cell_free(nc); return 1; } @@ -172,6 +173,7 @@ static void dump(struct image *win, signed int *ser, IntegerMatrix **mat, for ( i=0; i