aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src/fom.c
diff options
context:
space:
mode:
Diffstat (limited to 'libcrystfel/src/fom.c')
-rw-r--r--libcrystfel/src/fom.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libcrystfel/src/fom.c b/libcrystfel/src/fom.c
index 9ecb082d..d27023ae 100644
--- a/libcrystfel/src/fom.c
+++ b/libcrystfel/src/fom.c
@@ -84,6 +84,10 @@ static struct fom_context *init_fom(enum fom_type fom, int nmax, int nshells)
fctx->fom = fom;
fctx->nshells = nshells;
fctx->cts = malloc(nshells*sizeof(int));
+ if ( fctx->cts == NULL ) {
+ free(fctx);
+ return NULL;
+ }
for ( i=0; i<nshells; i++ ) {
fctx->cts[i] = 0;
}