X-Git-Url: https://git.octo.it/?p=rrdtool.git;a=blobdiff_plain;f=src%2Frrd_first.c;h=9de89e9dbdced4e0b3a6f306e9fab968427533f8;hp=1a8ff8a7eb02142fe80e4d734d2b1cb32b20432c;hb=fbe390e15d3484315efe5802577249c8959e3556;hpb=37329a5f991870e8f47c8a52f6dd594fef813de6 diff --git a/src/rrd_first.c b/src/rrd_first.c index 1a8ff8a..9de89e9 100644 --- a/src/rrd_first.c +++ b/src/rrd_first.c @@ -1,5 +1,5 @@ /***************************************************************************** - * RRDtool 1.2.6 Copyright by Tobi Oetiker, 1997-2005 + * RRDtool 1.2.21 Copyright by Tobi Oetiker, 1997-2007 ***************************************************************************** * rrd_first Return ***************************************************************************** @@ -24,7 +24,6 @@ rrd_first(int argc, char **argv) }; int option_index = 0; int opt; - optind = 0; opterr = 0; /* initialize getopt */ opt = getopt_long(argc, argv, "", long_options, &option_index); if(opt == EOF) @@ -69,6 +68,8 @@ rrd_first_r(const char *filename, const int rraindex) if((rraindex < 0) || (rraindex >= (int)rrd.stat_head->rra_cnt)) { rrd_set_error("invalid rraindex number"); + rrd_free(&rrd); + fclose(in_file); return(-1); }