[PATCH 2/3] eject: close open file [cppcheck]

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

 



[eject.c:498]: (error) Resource leak: f

Signed-off-by: Sami Kerola <kerolasa@xxxxxx>
---
 sys-utils/eject.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/sys-utils/eject.c b/sys-utils/eject.c
index 790ab3a..2056bf8 100644
--- a/sys-utils/eject.c
+++ b/sys-utils/eject.c
@@ -495,6 +495,7 @@ static int read_speed(const char *devname)
 					errx(EXIT_FAILURE,
 						_("%s: failed to read speed"),
 						_PATH_PROC_CDROMINFO);
+				fclose(f);
 				return atoi(str);
 			}
 		}
-- 
1.7.9.6

--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux