summaryrefslogtreecommitdiff
path: root/src/sysfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sysfs.c')
-rw-r--r--src/sysfs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/sysfs.c b/src/sysfs.c
index f2c616e..71e84e7 100644
--- a/src/sysfs.c
+++ b/src/sysfs.c
@@ -50,8 +50,9 @@ int sysfs_read_file(const char * path, char **output)
}
length = read(fd, result, resultsize-1);
+ close(fd);
+
if (length < 0) {
- close(fd);
ret = -1;
goto free_out;
}