From 40c2cce772ed74e7c6d302a6143ad818e9a2720d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 21 Mar 2013 19:10:50 -0400 Subject: [PATCH] bootchart: fix two unitialized memory frees The new gcc isn't bad! In file included from src/bootchart/svg.c:36:0: src/bootchart/svg.c: In function 'svg_ps_bars': ./src/shared/util.h:524:13: warning: 'enc_name' may be used uninitialized in this function [-Wmaybe-uninitialized] free(*(void**) p); ^ src/bootchart/svg.c:821:37: note: 'enc_name' was declared here char _cleanup_free_*enc_name; ^ CC src/udev/mtd_probe/mtd_probe-probe_smartmedia.o XSLT man/systemd.unit.5 In file included from src/bootchart/svg.c:36:0: src/bootchart/svg.c: In function 'svg_pss_graph': ./src/shared/util.h:524:13: warning: 'enc_name' may be used uninitialized in this function [-Wmaybe-uninitialized] free(*(void**) p); ^ src/bootchart/svg.c:395:37: note: 'enc_name' was declared here char _cleanup_free_*enc_name; ^ --- src/bootchart/svg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bootchart/svg.c b/src/bootchart/svg.c index 231d3daa8..cd896895c 100644 --- a/src/bootchart/svg.c +++ b/src/bootchart/svg.c @@ -392,7 +392,7 @@ static void svg_pss_graph(void) { svg("\n\n\n"); ps = ps_first; while (ps->next_ps) { - char _cleanup_free_*enc_name; + char _cleanup_free_ *enc_name = NULL; ps = ps->next_ps; if (!ps) continue; @@ -818,7 +818,7 @@ static void svg_ps_bars(void) { /* pass 2 - ps boxes */ ps = ps_first; while ((ps = get_next_ps(ps))) { - char _cleanup_free_*enc_name; + char _cleanup_free_ *enc_name = NULL; double starttime; int t; -- 2.30.2