aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2020-03-19 15:33:59 +0100
committerThomas White <taw@physics.org>2020-07-29 18:42:57 +0200
commit80457174459a48f1a073820582c964dcf65ab54b (patch)
treedef89001fd9e03e83be953f20d948e4bea5b108e /libcrystfel
parenta0773c8a3c5eb6c13a89bab0772dc354ea00f0c7 (diff)
Check that dp/mask/sat exist before freeing
Diffstat (limited to 'libcrystfel')
-rw-r--r--libcrystfel/src/image.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libcrystfel/src/image.c b/libcrystfel/src/image.c
index bae1d47b..00688f3e 100644
--- a/libcrystfel/src/image.c
+++ b/libcrystfel/src/image.c
@@ -1903,9 +1903,9 @@ void image_free(struct image *image)
}
for ( i=0; i<np; i++ ) {
- free(image->dp[i]);
- free(image->sat[i]);
- free(image->bad[i]);
+ if ( image->dp != NULL ) free(image->dp[i]);
+ if ( image->sat != NULL ) free(image->sat[i]);
+ if ( image->bad != NULL ) free(image->bad[i]);
}
free(image->dp);