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=bbe65afeef87f3b79e094802414890360879821a;p=rrdtool-all.git free the linebuffer if you don't return it! git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk@1470 a5681a0c-68f1-0310-ab6d-d61299d08faa --- 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(