X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Frrd_first.c;h=2ec522dba8a75aceb1e397b39ffdb12594c4bc0a;hb=1ebab4816e7bd2d606d2f99b07cec11c1468170c;hp=a3ad0908ba3c8a2184a5600fa1e6ee42fa1f0864;hpb=554df7224e8b3fec9ec5981812b453c43072f150;p=rrdtool.git diff --git a/src/rrd_first.c b/src/rrd_first.c index a3ad090..2ec522d 100644 --- a/src/rrd_first.c +++ b/src/rrd_first.c @@ -1,5 +1,5 @@ /***************************************************************************** - * RRDtool 1.2.4 Copyright by Tobi Oetiker, 1997-2005 + * RRDtool 1.2.17 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); }