summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2a4b79a)
raw | patch | inline | side by side (parent: 2a4b79a)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Sun, 4 Mar 2001 10:29:20 +0000 (10:29 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Sun, 4 Mar 2001 10:29:20 +0000 (10:29 +0000) |
-- Mike Franusich <mike@franusich.com>
git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk@19 a5681a0c-68f1-0310-ab6d-d61299d08faa
git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk@19 a5681a0c-68f1-0310-ab6d-d61299d08faa
program/src/rrd_open.c | patch | blob | history |
diff --git a/program/src/rrd_open.c b/program/src/rrd_open.c
index 36bc87585dec88facb3b123a0331774bcc6f8de4..1a3496d444564d79ccfd6a9e4a82d88882a8db7b 100644 (file)
--- a/program/src/rrd_open.c
+++ b/program/src/rrd_open.c
*****************************************************************************
* $Id$
* $Log$
- * Revision 1.1 2001/02/25 22:25:05 oetiker
- * Initial revision
+ * Revision 1.2 2001/03/04 10:29:20 oetiker
+ * fixed filedescriptor leak
+ * -- Mike Franusich <mike@franusich.com>
+ *
+ * Revision 1.1.1.1 2001/02/25 22:25:05 oetiker
+ * checkin
*
*****************************************************************************/
#define MYFREAD(MYVAR,MYVART,MYCNT) \
if ((MYVAR = malloc(sizeof(MYVART) * MYCNT)) == NULL) {\
rrd_set_error("" #MYVAR " malloc"); \
+ fclose(*in_file); \
return (-1); } \
fread(MYVAR,sizeof(MYVART),MYCNT, *in_file);
if (strncmp(rrd->stat_head->cookie,RRD_COOKIE,4) != 0){
rrd_set_error("'%s' is not an RRD file",file_name);
free(rrd->stat_head);
+ fclose(*in_file);
return(-1);}
if (strncmp(rrd->stat_head->version,RRD_VERSION,5) != 0){
- rrd_set_error("cant handle RRD file version %s",
+ rrd_set_error("can't handle RRD file version %s",
rrd->stat_head->version);
free(rrd->stat_head);
+ fclose(*in_file);
return(-1);}
if (rrd->stat_head->float_cookie != FLOAT_COOKIE){
rrd_set_error("This RRD was created on other architecture");
free(rrd->stat_head);
+ fclose(*in_file);
return(-1);}
MYFREAD(rrd->ds_def, ds_def_t, rrd->stat_head->ds_cnt)