From 36fd683318a492d56a990e470b28a8119066ecff Mon Sep 17 00:00:00 2001 From: oetiker Date: Tue, 25 May 2004 20:57:58 +0000 Subject: [PATCH] Clear out previous legend array contents before freeing legend array. Problem could manifest under extreme resource limits. Not tested. -- Mike Slifcak git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@266 a5681a0c-68f1-0310-ab6d-d61299d08faa --- src/rrd_xport.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/rrd_xport.c b/src/rrd_xport.c index 488c24c..c12b783 100644 --- a/src/rrd_xport.c +++ b/src/rrd_xport.c @@ -376,8 +376,10 @@ rrd_xport_fn(image_desc_t *im, if ((legend_list[j] = malloc(sizeof(char) * (FMT_LEG_LEN+5)))==NULL) { free(srcptr_list); free(ref_list); + free(*data); *data = NULL; + while (--j > -1) free(legend_list[j]); free(legend_list); - rrd_set_error("malloc xprint legend entry"); + rrd_set_error("malloc xport legend entry"); return(-1); } -- 2.11.0