aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2021-01-27 17:00:51 +0100
committerThomas White <taw@physics.org>2021-01-27 17:00:51 +0100
commit6e8909bab274250bc9c4cedc83ea459b6e432beb (patch)
tree52a21d4b6b3014f97248831fb999463df89d6984 /libcrystfel/src
parenta1d18a25c32febb754c8ecf4c98320c111e52ad8 (diff)
partialator/reflist: Propagate calloc NULL return
This prevents an out-of-memory situation (due to ulimit) from manifesting as a segfault.
Diffstat (limited to 'libcrystfel/src')
-rw-r--r--libcrystfel/src/reflist.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libcrystfel/src/reflist.c b/libcrystfel/src/reflist.c
index 6435e056..629b083c 100644
--- a/libcrystfel/src/reflist.c
+++ b/libcrystfel/src/reflist.c
@@ -127,6 +127,7 @@ static Reflection *new_node(unsigned int serial)
Reflection *new;
new = calloc(1, sizeof(struct _reflection));
+ if ( new == NULL ) return NULL;
new->serial = serial;
new->next = NULL;
new->prev = NULL;