linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] tools/csr_usb : Fix Resource leak: file
@ 2014-10-15 14:08 Gowtham Anandha Babu
  2014-10-15 14:08 ` [PATCH 2/4] tools/hciattach : Fix syntax error Gowtham Anandha Babu
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Gowtham Anandha Babu @ 2014-10-15 14:08 UTC (permalink / raw)
  To: linux-bluetooth
  Cc: luiz.dentz, d.kasatkin, bharat.panda, cpgs, Gowtham Anandha Babu

Handles resource leak.
---
 tools/csr_usb.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tools/csr_usb.c b/tools/csr_usb.c
index 5fb6bdc..a1d7324 100644
--- a/tools/csr_usb.c
+++ b/tools/csr_usb.c
@@ -80,9 +80,12 @@ static int read_value(const char *name, const char *attr, const char *format)
 		return -1;
 
 	n = fscanf(file, format, &value);
-	if (n != 1)
+	if (n != 1) {
+		fclose(file);
 		return -1;
+	}
 
+	fclose(file);
 	return value;
 }
 
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-10-16  8:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-15 14:08 [PATCH 1/4] tools/csr_usb : Fix Resource leak: file Gowtham Anandha Babu
2014-10-15 14:08 ` [PATCH 2/4] tools/hciattach : Fix syntax error Gowtham Anandha Babu
2014-10-15 14:08 ` [PATCH 3/4] obexd/src/main: Fix coding style and improves readability Gowtham Anandha Babu
2014-10-15 14:08 ` [PATCH 4/4] Fix enum coding-style Gowtham Anandha Babu
2014-10-16  7:59   ` Luiz Augusto von Dentz
2014-10-16  8:17 ` [PATCH 1/4] tools/csr_usb : Fix Resource leak: file Luiz Augusto von Dentz
2014-10-16  8:57   ` Gowtham Anandha Babu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).