aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src/events.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2014-10-22 17:50:54 +0200
committerThomas White <taw@physics.org>2014-10-23 17:02:33 +0200
commitd6182fc9c905daefc31144c57ba82db80b419874 (patch)
tree2e577af1a4fc06b72ccef4c7cfd2f0259956c413 /libcrystfel/src/events.c
parent1a37de5cce5c2df83e37fb189409659299594b1b (diff)
Fussiness
Diffstat (limited to 'libcrystfel/src/events.c')
-rw-r--r--libcrystfel/src/events.c14
1 files 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; di<dim_entry; di++ ) {
new_dims[di] = HYSL_UNDEFINED;
@@ -668,9 +664,7 @@ int set_dim_structure_entry(struct dim_structure *hsd, const char *string_dim,
}
new_dims[dim_entry-1] = parse_dim_structure_val(val_string);
- if ( hsd->dims == NULL ) {
- free (hsd->dims);
- }
+ free(hsd->dims);
hsd->dims = new_dims;
hsd->num_dims = dim_entry;