aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libcrystfel/src/stream.c2
-rw-r--r--src/partial_sim.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/libcrystfel/src/stream.c b/libcrystfel/src/stream.c
index 808be152..e7062e25 100644
--- a/libcrystfel/src/stream.c
+++ b/libcrystfel/src/stream.c
@@ -1043,6 +1043,8 @@ void write_geometry_file(Stream *st, const char *geom_filename) {
FILE *geom_fh;
char *rval;
+ if ( geom_filename == NULL ) return;
+
geom_fh = fopen(geom_filename, "r");
if ( geom_fh == NULL ) {
ERROR("Failed to read detector geometry from "
diff --git a/src/partial_sim.c b/src/partial_sim.c
index a113532b..ebff2e20 100644
--- a/src/partial_sim.c
+++ b/src/partial_sim.c
@@ -646,7 +646,6 @@ int main(int argc, char *argv[])
ERROR("Failed to read geometry from '%s'\n", geomfile);
return 1;
}
- free(geomfile);
if ( sym_str == NULL ) sym_str = strdup("1");
sym = get_pointgroup(sym_str);
@@ -845,6 +844,7 @@ int main(int argc, char *argv[])
free_symoplist(sym);
reflist_free(full);
free(save_file);
+ free(geomfile);
return 0;
}