aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src/stream.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2021-07-21 11:51:56 +0200
committerThomas White <taw@physics.org>2021-07-21 15:34:31 +0200
commit6d94d4115c254d344bbb927596a7141ef39fd298 (patch)
tree652d07c4d6a9521c9359aa13bbda27309f53e6f8 /libcrystfel/src/stream.c
parent50cf52b0bc0baa683b9508568131a3f6281bf4ff (diff)
Add missing cleanup on error paths
Diffstat (limited to 'libcrystfel/src/stream.c')
-rw-r--r--libcrystfel/src/stream.c5
1 files changed, 4 insertions, 1 deletions
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;