diff options
author | Thomas White <taw@physics.org> | 2023-07-26 16:23:17 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2023-07-28 13:22:05 +0200 |
commit | 9677bc525b41a133ca611b60a383dab58b0ea5f9 (patch) | |
tree | cfaf51924ba0ab39bc046812b2b96f620cfa86e1 /libcrystfel | |
parent | 975ed3e8b0d44d053dda10bfc6a20389a31bbbd4 (diff) |
Initialise det->top_group
Diffstat (limited to 'libcrystfel')
-rw-r--r-- | libcrystfel/src/datatemplate.c | 2 | ||||
-rw-r--r-- | libcrystfel/src/detgeom.c | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/libcrystfel/src/datatemplate.c b/libcrystfel/src/datatemplate.c index 12d4d85f..26d0bd06 100644 --- a/libcrystfel/src/datatemplate.c +++ b/libcrystfel/src/datatemplate.c @@ -1912,6 +1912,8 @@ struct detgeom *create_detgeom(struct image *image, detgeom = malloc(sizeof(struct detgeom)); if ( detgeom == NULL ) return NULL; + detgeom->top_group = NULL; + detgeom->panels = malloc(dtempl->n_panels*sizeof(struct detgeom_panel)); if ( detgeom->panels == NULL ) { free(detgeom); diff --git a/libcrystfel/src/detgeom.c b/libcrystfel/src/detgeom.c index 3516d996..b4835317 100644 --- a/libcrystfel/src/detgeom.c +++ b/libcrystfel/src/detgeom.c @@ -68,6 +68,8 @@ static void free_group(struct detgeom_panel_group *g) { int i; + if ( g == NULL ) return; + for ( i=0; i<g->n_children; i++ ) { free_group(g->children[i]); } |