From: oetiker Date: Wed, 11 Jul 2007 23:06:00 +0000 (+0000) Subject: stop rrd_create from leaking on failure ... vito caputo X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=33d28d0a161ea596872b4638726a23562e2c4c8c;p=rrdtool-all.git stop rrd_create from leaking on failure ... vito caputo git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.2@1145 a5681a0c-68f1-0310-ab6d-d61299d08faa --- diff --git a/program/src/rrd_create.c b/program/src/rrd_create.c index e9ac860d..16bde5bc 100644 --- a/program/src/rrd_create.c +++ b/program/src/rrd_create.c @@ -558,12 +558,7 @@ rrd_create_fn(const char *file_name, rrd_t *rrd) if ((rrd_file = fopen(file_name,"wb")) == NULL ) { rrd_set_error("creating '%s': %s",file_name, rrd_strerror(errno)); - free(rrd->stat_head); - rrd->stat_head = NULL; - free(rrd->ds_def); - rrd->ds_def = NULL; - free(rrd->rra_def); - rrd->rra_def = NULL; + rrd_free(rrd); return(-1); }