projects
/
platform
/
core
/
system
/
swap-manager.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
696f48d
)
[FIX] skip line function
84/45584/6
author
Vitaliy Cherepanov
<v.cherepanov@samsung.com>
Fri, 7 Aug 2015 13:34:17 +0000
(16:34 +0300)
committer
Vitaliy Andreevich
<v.cherepanov@samsung.com>
Wed, 12 Aug 2015 11:16:15 +0000
(
04:16
-0700)
fix possible fail on reading proc files
Change-Id: I883cc7a1902c54360fdc912e64d5f8d13bc7e54e
Signed-off-by: Vitaliy Cherepanov <v.cherepanov@samsung.com>
daemon/sys_stat.c
patch
|
blob
|
history
diff --git
a/daemon/sys_stat.c
b/daemon/sys_stat.c
index
2abe299
..
52083a2
100644
(file)
--- a/
daemon/sys_stat.c
+++ b/
daemon/sys_stat.c
@@
-1505,10
+1505,11
@@
static void skip_lines(FILE * fp, unsigned int count)
size_t buflen;
unsigned int index;
for (index = 0; index != count; ++index) {
+ buffer = NULL;
if (getline(&buffer, &buflen, fp) < 0)
LOGE("file scan fail\n");
+ free(buffer);
}
- free(buffer);
}
static int skip_tokens(FILE * fp, unsigned int count)