Message ID | 0b9c7176d7122253e20f0bc88fb1c79c3efb5dcf.1639411309.git.gitgitgadget@gmail.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | Reftable coverity fixes | expand |
diff --git a/reftable/blocksource.c b/reftable/blocksource.c index 0044eecd9aa..2605371c28d 100644 --- a/reftable/blocksource.c +++ b/reftable/blocksource.c @@ -134,8 +134,10 @@ int reftable_block_source_from_file(struct reftable_block_source *bs, } err = fstat(fd, &st); - if (err < 0) - return -1; + if (err < 0) { + close(fd); + return REFTABLE_IO_ERROR; + } p = reftable_calloc(sizeof(struct file_block_source)); p->size = st.st_size;