From d6182fc9c905daefc31144c57ba82db80b419874 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Wed, 22 Oct 2014 17:50:54 +0200 Subject: Fussiness --- libcrystfel/src/events.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/libcrystfel/src/events.c b/libcrystfel/src/events.c index 19d69b81..60727341 100644 --- a/libcrystfel/src/events.c +++ b/libcrystfel/src/events.c @@ -596,10 +596,9 @@ char *partial_event_substitution(struct event *ev, const char *data) struct dim_structure *initialize_dim_structure() { struct dim_structure *hs; + hs = malloc(sizeof(struct dim_structure)); - if ( hs == NULL ) { - return NULL; - } + if ( hs == NULL ) return NULL; hs->dims = NULL; hs->num_dims = 0; @@ -654,10 +653,7 @@ int set_dim_structure_entry(struct dim_structure *hsd, const char *string_dim, int di; int *new_dims = malloc(dim_entry*sizeof(int)); - if ( new_dims == NULL ) { - return 0; - } - + if ( new_dims == NULL ) return 0; for ( di=0; didims == NULL ) { - free (hsd->dims); - } + free(hsd->dims); hsd->dims = new_dims; hsd->num_dims = dim_entry; -- cgit v1.2.3