aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src/stream.c
diff options
context:
space:
mode:
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;