aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src/image.c
diff options
context:
space:
mode:
Diffstat (limited to 'libcrystfel/src/image.c')
-rw-r--r--libcrystfel/src/image.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/libcrystfel/src/image.c b/libcrystfel/src/image.c
index 74e6d8d3..3c5af479 100644
--- a/libcrystfel/src/image.c
+++ b/libcrystfel/src/image.c
@@ -603,7 +603,10 @@ int create_detgeom(struct image *image, const DataTemplate *dtempl)
if ( detgeom == NULL ) return 1;
detgeom->panels = malloc(dtempl->n_panels*sizeof(struct detgeom_panel));
- if ( detgeom->panels == NULL ) return 1;
+ if ( detgeom->panels == NULL ) {
+ free(detgeom);
+ return 1;
+ }
detgeom->n_panels = dtempl->n_panels;
@@ -1493,7 +1496,10 @@ char **image_expand_frames(const DataTemplate *dtempl,
list = malloc(sizeof(char *));
if ( list == NULL ) return NULL;
list[0] = strdup("//");
- if ( list[0] == NULL ) return NULL;
+ if ( list[0] == NULL ) {
+ free(list);
+ return NULL;
+ }
*n_frames = 1;
return list;
}