diff options
author | Thomas White <taw@physics.org> | 2021-09-07 16:29:17 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2021-09-07 16:29:17 +0200 |
commit | 0533223051101f087797cc6543ee0e286376fd5e (patch) | |
tree | d02c96051a179d9cd25757e1d2b598f82cfa53d4 /libcrystfel | |
parent | c006a3f7d88b9eb6e1f119ff16ce70ed5f5c5da2 (diff) |
assplode(): Add some assertions
Diffstat (limited to 'libcrystfel')
-rw-r--r-- | libcrystfel/src/utils.c | 3 |
1 files changed, 3 insertions, 0 deletions
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 <gsl/gsl_blas.h> #include <gsl/gsl_linalg.h> #include <gsl/gsl_eigen.h> +#include <assert.h> #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++; |