From 760f17f56b7f79f67a9029cbe7cc55a0acccd3b9 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Wed, 21 Jul 2021 12:11:42 +0200 Subject: Make sure that memory gets freed on realloc failure --- libcrystfel/src/indexers/taketwo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libcrystfel/src/indexers') diff --git a/libcrystfel/src/indexers/taketwo.c b/libcrystfel/src/indexers/taketwo.c index cd4d87a6..72aa0bad 100644 --- a/libcrystfel/src/indexers/taketwo.c +++ b/libcrystfel/src/indexers/taketwo.c @@ -1751,7 +1751,7 @@ static int match_obs_to_cell_vecs(struct TheoryVec *cell_vecs, int cell_vec_coun /* we have a match, add to array! */ size_t new_size = (count+1)*sizeof(struct sortme); - for_sort = realloc(for_sort, new_size); + for_sort = srealloc(for_sort, new_size); if ( for_sort == NULL ) return 0; -- cgit v1.2.3