[klibc] [PATCH 1/2] utils: losesetup close fd

maximilian attems max at stro.at
Wed Nov 10 07:07:48 PST 2010


fix ressource leakage.

Signed-off-by: maximilian attems <max at stro.at>
---
 usr/utils/losetup.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/usr/utils/losetup.c b/usr/utils/losetup.c
index 1104fd3..1a47fa9 100644
--- a/usr/utils/losetup.c
+++ b/usr/utils/losetup.c
@@ -339,6 +339,7 @@ int del_loop (const char *device)
 	}
 	if (ioctl (fd, LOOP_CLR_FD, 0) < 0) {
 		perror ("ioctl: LOOP_CLR_FD");
+		close (fd);
 		return 1;
 	}
 	close (fd);
-- 
1.7.2.3



More information about the klibc mailing list