]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Fix file descriptor handling in zdb_copy_object()
authorRichard Yao <richard.yao@alumni.stonybrook.edu>
Mon, 12 Sep 2022 19:34:10 +0000 (15:34 -0400)
committerGitHub <noreply@github.com>
Mon, 12 Sep 2022 19:34:10 +0000 (12:34 -0700)
commit7195c04d986ecd26c25c13e3c180790a2e85a723
tree76bc14ab8a968142d0c49c2b046fe18f83db33e5
parent13f2b8fb92c23090b9f6e701c8471aef6b8e917b
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
cmd/zdb/zdb.c