From: oetiker Date: Tue, 6 Jan 2009 14:54:41 +0000 (+0000) Subject: fix for segfault in rrd_cgi: caused by freeing a invalid address when printing an... X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=3829d9b31a737f2033241549f7c6b74b6a1469c8;p=rrdtool.git fix for segfault in rrd_cgi: caused by freeing a invalid address when printing an error message. git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.2/program@1724 a5681a0c-68f1-0310-ab6d-d61299d08faa --- diff --git a/src/rrd_cgi.c b/src/rrd_cgi.c index 6b1cf36..9f0a0bd 100644 --- a/src/rrd_cgi.c +++ b/src/rrd_cgi.c @@ -305,6 +305,7 @@ static void calfree (void){ if (calcpr) { free(calcpr); } + calcpr=NULL; } } @@ -778,7 +779,6 @@ char* drawgraph(long argc, const char **args){ char *err = malloc((strlen(rrd_get_error())+DS_NAM_SIZE)*sizeof(char)); sprintf(err, "[ERROR: %s]",rrd_get_error()); rrd_clear_error(); - calfree(); return err; } }