aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2010-06-14 17:17:02 -0700
committerThomas White <taw@physics.org>2012-02-22 15:26:50 +0100
commit9d397a6a1da81191e76688077bd694abf6ed5cd3 (patch)
treef5d7aeda84e0c204ac053c3a470dd2bf07c6b6f7 /src
parent18cb33d0b9753eb9d0ef5eae31abc502e9ba1d27 (diff)
Fix memory leaks
Diffstat (limited to 'src')
-rw-r--r--src/detector.c5
-rw-r--r--src/pattern_sim.c2
2 files changed, 7 insertions, 0 deletions
diff --git a/src/detector.c b/src/detector.c
index d4744ffd..db713137 100644
--- a/src/detector.c
+++ b/src/detector.c
@@ -240,6 +240,11 @@ struct detector *get_detector_geometry(const char *filename)
ERROR("Unrecognised field '%s'\n", path[1]);
}
+ for ( i=0; i<n1; i++ ) free(bits[i]);
+ for ( i=0; i<n2; i++ ) free(path[i]);
+ free(bits);
+ free(path);
+
} while ( rval != NULL );
if ( det->n_panels == -1 ) {
diff --git a/src/pattern_sim.c b/src/pattern_sim.c
index 1f12caa2..798e9c33 100644
--- a/src/pattern_sim.c
+++ b/src/pattern_sim.c
@@ -474,6 +474,8 @@ skip:
free(powder);
free(cell);
free(intensities);
+ free(outfile);
+ free(filename);
return 0;
}