aboutsummaryrefslogtreecommitdiffstats
path: root/spaceman
diff options
context:
space:
mode:
authorBill O'Donnell <billodo@redhat.com>2017-06-29 13:05:58 -0500
committerEric Sandeen <sandeen@redhat.com>2017-06-29 13:05:58 -0500
commit1cda90906c093d30911c0a20f214d68a1d220cdd (patch)
tree56c696ca8d9fa01915b718ece4e48fce0cd97079 /spaceman
parente177680d579619c54bf65adb7963e74e435eeb3b (diff)
downloadxfsprogs-dev-1cda90906c093d30911c0a20f214d68a1d220cdd.tar.gz
xfs_spaceman: close open file for error case in openfile()
openfile() fails to close the open file in one error case. Add close(fd) to correct the condition. Addresses-Coverity-Id: 1413770 Signed-off-by: Bill O'Donnell <billodo@redhat.com> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Diffstat (limited to 'spaceman')
-rw-r--r--spaceman/file.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/spaceman/file.c b/spaceman/file.c
index 4ab3090072..4c13b4a870 100644
--- a/spaceman/file.c
+++ b/spaceman/file.c
@@ -79,6 +79,7 @@ openfile(
if (!fsp) {
fprintf(stderr, _("%s: cannot find mount point."),
path);
+ close(fd);
return -1;
}
memcpy(fs_path, fsp, sizeof(struct fs_path));