From abbad4011e4ba21c20aad2602327037d8996aac7 Mon Sep 17 00:00:00 2001 From: oetiker Date: Thu, 1 Aug 2002 05:42:27 +0000 Subject: [PATCH] fix for segfault condition in print_calc -- Paul Clifford git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk@161 a5681a0c-68f1-0310-ab6d-d61299d08faa --- program/src/rrd_graph.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/program/src/rrd_graph.c b/program/src/rrd_graph.c index 18be5737..2fc65263 100644 --- a/program/src/rrd_graph.c +++ b/program/src/rrd_graph.c @@ -1285,6 +1285,7 @@ print_calc(image_desc_t *im, char ***prdata) if (im->gdes[i].gf == GF_PRINT){ (*prdata)[prlines-2] = malloc((FMT_LEG_LEN+2)*sizeof(char)); + (*prdata)[prlines-1] = NULL; if (bad_format(im->gdes[i].format)) { rrd_set_error("bad format for [G]PRINT in '%s'", im->gdes[i].format); return -1; @@ -1294,7 +1295,6 @@ print_calc(image_desc_t *im, char ***prdata) #else sprintf((*prdata)[prlines-2],im->gdes[i].format,printval,si_symb); #endif - (*prdata)[prlines-1] = NULL; } else { /* GF_GPRINT */ -- 2.30.2