From: oetiker Date: Thu, 28 Aug 2008 04:13:39 +0000 (+0000) Subject: free the linebuffer if you don't return it! X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=e19258f061340d0b2032fa1a1020d1a89a24b85d;p=rrdtool.git 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 --- 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(