summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 61a736a)
raw | patch | inline | side by side (parent: 61a736a)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Tue, 25 May 2004 20:53:21 +0000 (20:53 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Tue, 25 May 2004 20:53:21 +0000 (20:53 +0000) |
src/rrd_create.c | patch | blob | history | |
src/rrd_dump.c | patch | blob | history |
diff --git a/src/rrd_create.c b/src/rrd_create.c
index 6573fc5a69280b9f67b526c8a24a2de025f8cd1e..90c38d338e9056d57e91f2152c9fc5cf0562d3cc 100644 (file)
--- a/src/rrd_create.c
+++ b/src/rrd_create.c
/* static header */
if((rrd.stat_head = calloc(1,sizeof(stat_head_t)))==NULL){
rrd_set_error("allocating rrd.stat_head");
+ rrd_free(&rrd);
return(-1);
}
/* live header */
if((rrd.live_head = calloc(1,sizeof(live_head_t)))==NULL){
rrd_set_error("allocating rrd.live_head");
+ rrd_free(&rrd);
return(-1);
}
fprintf(stderr,"Creating HW contingent RRAs\n");
#endif
if (create_hw_contingent_rras(&rrd,period,hashed_name) == -1) {
+ rrd_set_error("creating contingent RRA");
rrd_free(&rrd);
return -1;
}
diff --git a/src/rrd_dump.c b/src/rrd_dump.c
index e92bd8d4bb30c002c66524f064ada383fe97dd63..a8887ee82ab8ff4b0a6b5ed802c72f9f3b181c68 100644 (file)
--- a/src/rrd_dump.c
+++ b/src/rrd_dump.c
*****************************************************************************
* $Id$
* $Log$
+ * Revision 1.7 2004/05/25 20:53:21 oetiker
+ * prevent small leak when resources are exhausted -- Mike Slifcak
+ *
* Revision 1.6 2004/05/25 20:51:49 oetiker
* Update displayed copyright messages to be consistent. -- Mike Slifcak
*
rrd_value_t value;
struct tm tm;
if(rrd_open(filename, &in_file,&rrd, RRD_READONLY)==-1){
+ rrd_free(&rrd);
return(-1);
}