X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Frrd_first.c;h=39638a807c99108d9787317864bf39465960d140;hb=a6d79528b4812e8eb3927dba3cdd42e6ca51b287;hp=b0d3fb6d04c089ded1644041d7ca6ec065d57ea2;hpb=c112f7c06e534ce7a5a4e25b6f7f742aeb051850;p=rrdtool.git diff --git a/src/rrd_first.c b/src/rrd_first.c index b0d3fb6..39638a8 100644 --- a/src/rrd_first.c +++ b/src/rrd_first.c @@ -1,5 +1,5 @@ /***************************************************************************** - * RRDtool 1.2rc3 Copyright by Tobi Oetiker, 1997-2005 + * RRDtool 1.2.22 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); }