aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2019-01-29 16:37:47 +0100
committerThomas White <taw@physics.org>2019-01-29 16:37:47 +0100
commit83b4dbe4a0146da76fbb69fde213176d44e1a2ae (patch)
tree67e6138f4fda6ca17922e5e123ffeba4cd11ee1e /libcrystfel
parenta2c2df1885ea9d078ee8ad712d46c0a0392949e2 (diff)
Fix a couple of memory leaks
Diffstat (limited to 'libcrystfel')
-rw-r--r--libcrystfel/src/hdf5-file.c3
-rw-r--r--libcrystfel/src/xgandalf.c1
2 files changed, 4 insertions, 0 deletions
diff --git a/libcrystfel/src/hdf5-file.c b/libcrystfel/src/hdf5-file.c
index 7b81b407..6ede34bc 100644
--- a/libcrystfel/src/hdf5-file.c
+++ b/libcrystfel/src/hdf5-file.c
@@ -2216,6 +2216,7 @@ char *hdfile_get_string_value(struct hdfile *f, const char *name,
case H5T_FLOAT :
r = hdfile_get_value(f, subst_name, ev, &buf_f,
H5T_NATIVE_DOUBLE);
+ free(subst_name);
if ( r == 0 ) {
tmp = malloc(256);
if ( tmp == NULL ) {
@@ -2233,6 +2234,7 @@ char *hdfile_get_string_value(struct hdfile *f, const char *name,
case H5T_INTEGER :
r = hdfile_get_value(f, subst_name, ev, &buf_i,
H5T_NATIVE_INT);
+ free(subst_name);
if ( r == 0 ) {
tmp = malloc(256);
if ( tmp == NULL ) {
@@ -2250,6 +2252,7 @@ char *hdfile_get_string_value(struct hdfile *f, const char *name,
default :
ERROR("Don't know what to do!\n");
+ free(subst_name);
return NULL;
}
diff --git a/libcrystfel/src/xgandalf.c b/libcrystfel/src/xgandalf.c
index 2434ce2e..5f31df33 100644
--- a/libcrystfel/src/xgandalf.c
+++ b/libcrystfel/src/xgandalf.c
@@ -253,6 +253,7 @@ void xgandalf_cleanup(void *pp)
if(xgandalf_private_data->uncenteringTransformation != NULL){
tfn_free(xgandalf_private_data->uncenteringTransformation);
}
+ free(xgandalf_private_data);
}
static void reduceCell(UnitCell *cell, LatticeTransform_t* appliedReductionTransform)