From e19258f061340d0b2032fa1a1020d1a89a24b85d 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/program@1470 a5681a0c-68f1-0310-ab6d-d61299d08faa --- src/rrd_tool.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/rrd_tool.c b/src/rrd_tool.c index 80bdb6e..d08d7de 100644 --- a/src/rrd_tool.c +++ b/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