X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Frrd_first.c;h=2ec522dba8a75aceb1e397b39ffdb12594c4bc0a;hb=734468bcc23497c7eba0deba87c92aa219fd46d1;hp=a3f4306303af70322a68232e47a6ae3aee70ef79;hpb=0f399ee8cbe875b2831ea2870e60ee17800d811d;p=rrdtool.git diff --git a/src/rrd_first.c b/src/rrd_first.c index a3f4306..2ec522d 100644 --- a/src/rrd_first.c +++ b/src/rrd_first.c @@ -1,5 +1,5 @@ /***************************************************************************** - * RRDtool 1.2rc2 Copyright by Tobi Oetiker, 1997-2005 + * RRDtool 1.2.17 Copyright by Tobi Oetiker, 1997-2006 ***************************************************************************** * rrd_first Return ***************************************************************************** @@ -14,6 +14,7 @@ rrd_first(int argc, char **argv) { int target_rraindex=0; char *endptr; + optind = 0; opterr = 0; /* initialize getopt */ while (1){ static struct option long_options[] = @@ -67,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); }