projects
/
contrib
/
mraa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8862ebd
)
iio.c: Fix leaking filedescriptor on read error
author
Brendan Le Foll
<brendan.le.foll@intel.com>
Mon, 21 Dec 2015 15:37:37 +0000
(15:37 +0000)
committer
Brendan Le Foll
<brendan.le.foll@intel.com>
Mon, 21 Dec 2015 15:37:37 +0000
(15:37 +0000)
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
src/iio/iio.c
patch
|
blob
|
history
diff --git
a/src/iio/iio.c
b/src/iio/iio.c
index
365221b
..
1aee9fe
100644
(file)
--- a/
src/iio/iio.c
+++ b/
src/iio/iio.c
@@
-111,6
+111,7
@@
mraa_iio_get_channel_data(mraa_iio_context dev)
fd = open(buf, O_RDONLY);
if (fd != -1) {
if (read(fd, readbuf, 2 * sizeof(char)) != 2) {
+ close(fd);
break;
}
chan_num = ((int) strtol(readbuf, NULL, 10));