reftable/pq: handle allocation failures when adding entries

Handle allocation failures when adding entries to the pqueue. Adapt its
only caller accordingly.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Patrick Steinhardt
2024-10-02 12:56:22 +02:00
committed by Junio C Hamano
parent 2d5dbb37b2
commit d0501c8c9d
3 changed files with 11 additions and 3 deletions

View File

@@ -54,7 +54,10 @@ static int merged_iter_advance_subiter(struct merged_iter *mi, size_t idx)
if (err)
return err;
merged_iter_pqueue_add(&mi->pq, &e);
err = merged_iter_pqueue_add(&mi->pq, &e);
if (err)
return err;
return 0;
}