From 1cda90906c093d30911c0a20f214d68a1d220cdd Mon Sep 17 00:00:00 2001 From: Bill O'Donnell Date: Thu, 29 Jun 2017 13:05:58 -0500 Subject: [PATCH] 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 Reviewed-by: Darrick J. Wong Signed-off-by: Eric Sandeen --- spaceman/file.c | 1 + 1 file changed, 1 insertion(+) diff --git a/spaceman/file.c b/spaceman/file.c index 4ab309007..4c13b4a87 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)); -- 2.47.2