X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Frrd_first.c;h=33046596d05142311656bd787fcf8300fc3efb33;hb=3882bb0c2d15f97298aaa7602d6353a1888f5547;hp=0d16a31d3e484645e8b0ab397c3e2f63853c954c;hpb=ba6406d3684dcfc5e4dc4491f4f76562613bb0b6;p=rrdtool.git diff --git a/src/rrd_first.c b/src/rrd_first.c index 0d16a31..3304659 100644 --- a/src/rrd_first.c +++ b/src/rrd_first.c @@ -1,5 +1,5 @@ /***************************************************************************** - * RRDtool 1.0.49 Copyright Tobias Oetiker, 1997 - 2005 + * RRDtool 1.2.16 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); }