xfs_spaceman: close open file for error case in openfile()
PATCH 1/1 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.
Detected by CoverityScan, CID#1413770 (RESOURCE_LEAK)
Signed-off-by Bill O'Donnell <[email protected]>
--- spaceman/file.c | 1 + 1 file changed, 1 insertion(+)
spaceman/file.c +1 -0
@@ -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 ));
Signature · 1 line
2.13.0
Quoted 6 lines · Bill O'Donnell
openfile()fails to close the open file in one error case. Add close(fd) to correct the condition.Detected by CoverityScan, CID#1413770 (
RESOURCE_LEAK)Signed-off-by Bill O'Donnell <[email protected]>
Reviewed-by Darrick J. Wong <[email protected]>
--D
Quoted 23 lines
--- spaceman/file.c | 1 + 1 file changed, 1 insertion(+)spaceman/file.c +1
-0@@ -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 ));Signature · 6 lines
2.13.0 -- To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html