From 6d94d4115c254d344bbb927596a7141ef39fd298 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Wed, 21 Jul 2021 11:51:56 +0200 Subject: Add missing cleanup on error paths --- libcrystfel/src/stream.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'libcrystfel/src/stream.c') diff --git a/libcrystfel/src/stream.c b/libcrystfel/src/stream.c index cd64a485..8ffaed1a 100644 --- a/libcrystfel/src/stream.c +++ b/libcrystfel/src/stream.c @@ -1568,7 +1568,10 @@ static void add_index_record(StreamIndex *index, new_ptrs = realloc(index->ptrs, new_max_keys*sizeof(long int)); - if ( new_ptrs == NULL ) return; + if ( new_ptrs == NULL ) { + free(new_keys); + return; + } index->keys = new_keys; index->ptrs = new_ptrs; -- cgit v1.2.3