X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fturbostat.c;h=68cf412090fd2b767c67c5552f0bcccb6268821e;hb=74ee9a04ef5785b31d1acbfdcbcece3370668cfe;hp=2bc7e3f1e4869f1f3be03381c6648787df0a7b41;hpb=07ba05937aeaedd683656c3912040950dbf4a152;p=collectd.git diff --git a/src/turbostat.c b/src/turbostat.c index 2bc7e3f1..68cf4120 100644 --- a/src/turbostat.c +++ b/src/turbostat.c @@ -1289,15 +1289,15 @@ static int allocate_counters(struct thread_data **threads, *cores = calloc(total_cores, sizeof(struct core_data)); if (*cores == NULL) { ERROR("turbostat plugin: calloc failed"); - sfree(threads); + sfree(*threads); return -1; } *packages = calloc(topology.num_packages, sizeof(struct pkg_data)); if (*packages == NULL) { ERROR("turbostat plugin: calloc failed"); - sfree(cores); - sfree(threads); + sfree(*cores); + sfree(*threads); return -1; }