X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fturbostat.c;h=b5d35204d6ca08fb5bd527b6e7af800f704f89fa;hb=7c9d772c992647fcba64a96800c146eb9f1647f8;hp=2bc7e3f1e4869f1f3be03381c6648787df0a7b41;hpb=6e41c3b1f024d7944e5e8010a87933555c662474;p=collectd.git diff --git a/src/turbostat.c b/src/turbostat.c index 2bc7e3f1..b5d35204 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; } @@ -1429,7 +1429,7 @@ static int turbostat_read(void) { /* Saving the scheduling affinity, as it will be modified by get_counters */ if (sched_getaffinity(0, cpu_saved_affinity_setsize, cpu_saved_affinity_set) != 0) { - ERROR("turbostat plugin: Unable to save the CPU affinity"); + ERROR("turbostat plugin: Unable to save the CPU affinity: %s", STRERRNO); return -1; }