summaryrefslogtreecommitdiff
path: root/src/bootchart
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-01-25 10:33:07 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-01-25 10:38:42 -0500
commite985665d2d226cb42b52bfcad6fd5b1586ad57d7 (patch)
treee1dbc3753679aa9f677c4e7d49b7bd942e000e48 /src/bootchart
parent314b4b0a68d9ab35de981923a088fc8c8820caa5 (diff)
Add _cleanup_pclose_ and fix mismatching pipe close opened by popen()
Based-on-patch-by: Thomas Jarosch <thomas.jarosch@intra2net.com> cppcheck reported: [src/bootchart/svg.c:791]: (error) Mismatching allocation and deallocation: f
Diffstat (limited to 'src/bootchart')
-rw-r--r--src/bootchart/svg.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/bootchart/svg.c b/src/bootchart/svg.c
index 156918a94b..b9636e20a3 100644
--- a/src/bootchart/svg.c
+++ b/src/bootchart/svg.c
@@ -22,6 +22,8 @@
#include <sys/utsname.h>
#include "bootchart.h"
+#include "util.h"
+#include "macro.h"
#define time_to_graph(t) ((t) * scale_x)
@@ -702,7 +704,7 @@ static int ps_filter(struct ps_struct *ps)
static void svg_do_initcall(int count_only)
{
- FILE *f;
+ FILE _cleanup_pclose_ *f = NULL;
double t;
char func[256];
int ret;
@@ -787,8 +789,6 @@ static void svg_do_initcall(int count_only)
kcount++;
}
-
- fclose(f);
}