[PATCH 26/39] kpartx: fixup filedescriptor leak in set_loop()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Upon error 'ffd' was never closed.
Found by coverity.

Signed-off-by: Hannes Reinecke <hare@xxxxxxxx>
---
 kpartx/lopart.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kpartx/lopart.c b/kpartx/lopart.c
index e7f6090..5495e27 100644
--- a/kpartx/lopart.c
+++ b/kpartx/lopart.c
@@ -252,6 +252,7 @@ set_loop (const char *device, const char *file, int offset, int *loopro)
 	}
 
 	if ((fd = open (device, mode)) < 0) {
+		close(ffd);
 		perror (device);
 		return 1;
 	}
-- 
2.6.6

--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel



[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux