aboutsummaryrefslogtreecommitdiff
path: root/src/partialator.c
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 /src/partialator.c
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 'src/partialator.c')
-rw-r--r--src/partialator.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/partialator.c b/src/partialator.c
index 13b849e8..cd874cff 100644
--- a/src/partialator.c
+++ b/src/partialator.c
@@ -549,6 +549,10 @@ static RefList *apply_max_adu(RefList *list, double max_adu)
signed int h, k, l;
get_indices(refl, &h, &k, &l);
Reflection *nrefl = add_refl(nlist, h, k, l);
+ if ( nrefl == NULL ) {
+ ERROR("Failed to add reflection\n");
+ return NULL;
+ }
copy_data(nrefl, refl);
}
}