From 0533223051101f087797cc6543ee0e286376fd5e Mon Sep 17 00:00:00 2001 From: Thomas White Date: Tue, 7 Sep 2021 16:29:17 +0200 Subject: assplode(): Add some assertions --- libcrystfel/src/utils.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libcrystfel') diff --git a/libcrystfel/src/utils.c b/libcrystfel/src/utils.c index f787f82f..572db023 100644 --- a/libcrystfel/src/utils.c +++ b/libcrystfel/src/utils.c @@ -41,6 +41,7 @@ #include #include #include +#include #include "utils.h" #include "image.h" @@ -475,7 +476,9 @@ static int assplode_extract(char ***pbits, int n, size_t n_captured, { char **bits = *pbits; bits = realloc(bits, sizeof(char *)*(n+1)); + assert(bits != NULL); bits[n] = malloc(n_captured+1); + assert(bits[n] != NULL); memcpy(bits[n], a+start, n_captured); bits[n][n_captured] = '\0'; n++; -- cgit v1.2.3