HomeFreeBSD

Fix file descriptor handling in zdb_copy_object()

Description

Fix file descriptor handling in zdb_copy_object()

Coverity found a file descriptor leak. Eyeballing it showed that we had
no handling for the open() call failing either. We can address both of
these at once.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Neal Gompa <ngompa@datto.com>
Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Closes #13862

Details

Provenance
Richard Yao <richard.yao@alumni.stonybrook.edu>Authored on Sep 12 2022, 7:34 PM
GitHub <noreply@github.com>Committed on Sep 12 2022, 7:34 PM
Parents
rG13f2b8fb92c2: Fix use-after-free in btree code
Branches
Unknown
Tags
Unknown

Event Timeline

GitHub <noreply@github.com> committed rG7195c04d986e: Fix file descriptor handling in zdb_copy_object() (authored by Richard Yao <richard.yao@alumni.stonybrook.edu>).Sep 12 2022, 7:34 PM