Ticket #53 (closed defect: fixed)
rrd_first_r leave file descriptor open on error
| Reported by: | TvE | Owned by: | oetiker |
|---|---|---|---|
| Priority: | minor | Milestone: | |
| Component: | misc | Version: | 1.2.15 |
| Keywords: | Cc: |
Description
In rrd_first.c on line 71 the error return statement leaves the RRD file descriptor open. Lines 69-71 should be changed from:
if((rraindex < 0) || (rraindex >= (int)rrd.stat_head->rra_cnt)) {
rrd_set_error("invalid rraindex number");
return(-1);
}
to:
if((rraindex < 0) || (rraindex >= (int)rrd.stat_head->rra_cnt)) {
rrd_set_error("invalid rraindex number");
rrd_free(&rrd);
fclose(in_file);
return(-1);
}


