From: Peter Stamfest Date: Mon, 1 Sep 2014 18:37:44 +0000 (+0200) Subject: Avoid memory leak and handle out-of-memory in a forgotten case X-Git-Tag: v1.5.0-rc1~42^2~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b990a8bcc4c2430988ea44ee158ba02ba642cb81;p=thirdparty%2Frrdtool-1.x.git Avoid memory leak and handle out-of-memory in a forgotten case --- diff --git a/src/rrd_create.c b/src/rrd_create.c index cee6c633..cfd03e0d 100644 --- a/src/rrd_create.c +++ b/src/rrd_create.c @@ -2210,7 +2210,11 @@ static int rrd_prefill_data(rrd_t *rrd, const GList *sources, mapping_t *mapping mappings, mappings_cnt, cdp_match, NULL); + if (candidates == NULL && rrd_test_error()) { + goto done; + } prefill_cdp_prep(&target, candidates, candidate_cnt, cdp_rra_index); + free(candidates); } total_rows += rrd->rra_def[rra_index].row_cnt; }