X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Fintel_rdt.c;h=62848dbfe5e24046fae4a4f3ae76606720fb47b6;hp=743c8bc69651073b302235824c99fd4a149303e2;hb=54619dc85fd308b21ed09a0271e5c7383c7921b9;hpb=c3716ec215af04261b03cb6804dd561574e5d40d diff --git a/src/intel_rdt.c b/src/intel_rdt.c index 743c8bc6..62848dbf 100644 --- a/src/intel_rdt.c +++ b/src/intel_rdt.c @@ -325,8 +325,12 @@ static int strlisttoarray(char *str_list, char ***names, size_t *names_num) { continue; if ((isdupstr((const char **)*names, *names_num, token))) { - ERROR(RDT_PLUGIN ": Duplicated process name \'%s\' in group \'%s\'", - token, str_list); + if (str_list != NULL) + ERROR(RDT_PLUGIN ": Duplicated process name \'%s\' in group \'%s\'", + token, str_list); + else + ERROR(RDT_PLUGIN ": Duplicated process name \'%s\'", token); + return -EINVAL; } else { if (0 != strarray_add(names, names_num, token)) { @@ -851,9 +855,9 @@ static void rdt_init_pids_monitoring() { } /* update global proc_pids table */ - proc_pids_t **proc_pids = realloc(g_rdt->proc_pids, - (g_rdt->num_proc_pids + ng->num_names) * - sizeof(*g_rdt->proc_pids)); + proc_pids_t **proc_pids = + realloc(g_rdt->proc_pids, (g_rdt->num_proc_pids + ng->num_names) * + sizeof(*g_rdt->proc_pids)); if (NULL == proc_pids) { ERROR(RDT_PLUGIN ": Alloc error\n"); continue;