projects
/
platform
/
upstream
/
bluez.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
de90c33
)
tools/csr_usb: Fix resource leak
46/31546/1
author
Gowtham Anandha Babu
<gowtham.ab@samsung.com>
Fri, 5 Dec 2014 13:56:28 +0000
(19:26 +0530)
committer
Gowtham Anandha Babu
<gowtham.ab@samsung.com>
Fri, 5 Dec 2014 13:56:28 +0000
(19:26 +0530)
File opened with fopen() should be
closed by fclose().
Change-Id: I35b96e4087c0a51c6027bd6236543915039d7ebb
tools/csr_usb.c
patch
|
blob
|
history
diff --git
a/tools/csr_usb.c
b/tools/csr_usb.c
index
5fb6bdc
..
a1d7324
100644
(file)
--- 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;
}