From bbe65afeef87f3b79e094802414890360879821a Mon Sep 17 00:00:00 2001 From: oetiker Date: Thu, 28 Aug 2008 04:13:39 +0000 Subject: [PATCH] free the linebuffer if you don't return it! git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk@1470 a5681a0c-68f1-0310-ab6d-d61299d08faa --- program/src/rrd_tool.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/program/src/rrd_tool.c b/program/src/rrd_tool.c index 80bdb6e7..d08d7de7 100644 --- a/program/src/rrd_tool.c +++ b/program/src/rrd_tool.c @@ -369,7 +369,11 @@ static char *fgetslong( exit(1); } } - return *aLinePtr = linebuf[0] ? linebuf : 0; + if (linebuf[0]){ + return *aLinePtr = linebuf; + } + free(linebuf); + return *aLinePtr = 0; } int main( -- 2.30.2