X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Frrd_tool.c;h=80bdb6e70c399a662b9ef1c7f7aaae7d022453f6;hb=9a5fdb3f8db54f97bdab9284bbf15ff0b31a5169;hp=dc7ddb4a478636870e5aa4a0d0732af3117dc174;hpb=a5eb18ad8c70e530a2e28ed435a0f52da0f5bee0;p=rrdtool.git diff --git a/src/rrd_tool.c b/src/rrd_tool.c index dc7ddb4..80bdb6e 100644 --- a/src/rrd_tool.c +++ b/src/rrd_tool.c @@ -1,5 +1,5 @@ /***************************************************************************** - * RRDtool 1.3rc8 Copyright by Tobi Oetiker, 1997-2008 + * RRDtool 1.3.1 Copyright by Tobi Oetiker, 1997-2008 ***************************************************************************** * rrd_tool.c Startup wrapper *****************************************************************************/ @@ -364,6 +364,7 @@ static char *fgetslong( return *aLinePtr = linebuf; bufsize += MAX_LENGTH; if (!(linebuf = realloc(linebuf, bufsize))) { + free(linebuf); perror("fgetslong: realloc"); exit(1); } @@ -448,6 +449,7 @@ int main( while (fgetslong(&aLine, stdin)) { if ((argc = CountArgs(aLine)) == 0) { + free(aLine); printf("ERROR: not enough arguments\n"); } if ((myargv = (char **) malloc((argc + 1) * @@ -456,6 +458,8 @@ int main( exit(1); } if ((argc = CreateArgs(argv[0], aLine, argc, myargv)) < 0) { + free(aLine); + free(myargv); printf("ERROR: creating arguments\n"); } else { int ret = HandleInputLine(argc, myargv, stdout); @@ -804,7 +808,7 @@ int HandleInputLine( } } else if (strcmp("graphv", argv[1]) == 0) { - rrd_info_t *grinfo = NULL; /* 1 to distinguish it from the NULL that rrd_graph sends in */ + rrd_info_t *grinfo = NULL; /* 1 to distinguish it from the NULL that rrd_graph sends in */ grinfo = rrd_graph_v(argc - 1, &argv[1]); if (grinfo) {