X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Frrd_first.c;h=c1c545fd2e4070e114a41ccf9ffdeb51bec76c7b;hb=61c29df248b0890384adf6b63e556a24fd2b64bd;hp=1a8ff8a7eb02142fe80e4d734d2b1cb32b20432c;hpb=37329a5f991870e8f47c8a52f6dd594fef813de6;p=rrdtool.git diff --git a/src/rrd_first.c b/src/rrd_first.c index 1a8ff8a..c1c545f 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.15 Copyright by Tobi Oetiker, 1997-2006 ***************************************************************************** * 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); }