summaryrefslogtreecommitdiff
path: root/src/bootchart/log.c
diff options
context:
space:
mode:
authorLukas Nykryn <lnykryn@redhat.com>2013-01-09 17:10:57 +0100
committerKay Sievers <kay@vrfy.org>2013-01-09 17:15:19 +0100
commit0908dd2fd5536cf15d75780980ac2eca37ff800f (patch)
tree8651c958e7bd5941aea2297de561c560e576c6be /src/bootchart/log.c
parent3c123e0899b56c0587db36420da5e049c56d9e19 (diff)
bootchart: check return of fopen before setvbuf in log.c
Diffstat (limited to 'src/bootchart/log.c')
-rw-r--r--src/bootchart/log.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/bootchart/log.c b/src/bootchart/log.c
index 89c7b3523c..6c40913973 100644
--- a/src/bootchart/log.c
+++ b/src/bootchart/log.c
@@ -364,9 +364,9 @@ schedstat_next:
if (!ps->smaps) {
sprintf(filename, "/proc/%d/smaps", pid);
ps->smaps = fopen(filename, "r");
- setvbuf(ps->smaps, smaps_buf, _IOFBF, sizeof(smaps_buf));
if (!ps->smaps)
continue;
+ setvbuf(ps->smaps, smaps_buf, _IOFBF, sizeof(smaps_buf));
} else {
rewind(ps->smaps);
}