X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Frrd_first.c;h=274a75173ac7324fdf876a1b916718acc5ea99be;hb=2e6c98e893777e4abf7b05cb4ecf81dde088cdb8;hp=7452331720d3b8ccd15b5b30a68e05025b9179aa;hpb=6c5e7f32e3052259aa5e14053cb4bab04346ea94;p=rrdtool.git diff --git a/src/rrd_first.c b/src/rrd_first.c index 7452331..274a751 100644 --- a/src/rrd_first.c +++ b/src/rrd_first.c @@ -1,5 +1,5 @@ /***************************************************************************** - * RRDtool 1.2rc6 Copyright by Tobi Oetiker, 1997-2005 + * RRDtool 1.2.19 Copyright by Tobi Oetiker, 1997-2007 ***************************************************************************** * 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); }