diff --git a/reftable/block.c b/reftable/block.c index ad9074dba6121e..c469a9b529f47f 100644 --- a/reftable/block.c +++ b/reftable/block.c @@ -301,7 +301,7 @@ static int restart_key_less(size_t idx, void *args) result = strbuf_cmp(&a->key, &rkey); strbuf_release(&rkey); - return result; + return result < 0; } void block_iter_copy_from(struct block_iter *dest, struct block_iter *src) diff --git a/reftable/record.c b/reftable/record.c index 367de046006b25..2e2061d0823174 100644 --- a/reftable/record.c +++ b/reftable/record.c @@ -588,6 +588,8 @@ static int reftable_obj_record_decode(void *rec, struct strbuf key, uint64_t last; int j; + reftable_obj_record_release(r); + REFTABLE_ALLOC_ARRAY(r->hash_prefix, key.len); memcpy(r->hash_prefix, key.buf, key.len); r->hash_prefix_len = key.len;