Code

do not loose filedescriptors when rrd_first errors out
authoroetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Tue, 15 Aug 2006 05:51:04 +0000 (05:51 +0000)
committeroetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Tue, 15 Aug 2006 05:51:04 +0000 (05:51 +0000)
git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.2@880 a5681a0c-68f1-0310-ab6d-d61299d08faa

program/src/rrd_first.c

index 8df68b86735fd973c7c0c8b471f11f798f21c741..c1c545fd2e4070e114a41ccf9ffdeb51bec76c7b 100644 (file)
@@ -68,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);
     }