From: Tobias Oetiker Date: Thu, 28 Aug 2008 04:13:39 +0000 (+0000) Subject: free the linebuffer if you don't return it! X-Git-Tag: 1.3.2~14 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5e517123f67f2859db6ca4e7278efbaa7e894dd0;p=thirdparty%2Frrdtool-1.x.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 80bdb6e7..d08d7de7 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(