mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-12 12:14:36 +03:00
Extract string writing/buffer handling into some callback
This commit is contained in:
@ -905,14 +905,14 @@ static void LinuxProcessList_readCGroupFile(LinuxProcess* process, openat_arg_t
|
||||
if (!changed)
|
||||
return;
|
||||
|
||||
char* cgroup_short = xCalloc(strlen(process->cgroup) + 1, 1);
|
||||
if (CGroup_filterName(process->cgroup, cgroup_short, strlen(process->cgroup) + 1)) {
|
||||
char* cgroup_short = CGroup_filterName(process->cgroup);
|
||||
if (cgroup_short) {
|
||||
free_and_xStrdup(&process->cgroup_short, cgroup_short);
|
||||
free(cgroup_short);
|
||||
} else {
|
||||
free(process->cgroup_short);
|
||||
process->cgroup_short = NULL;
|
||||
}
|
||||
free(cgroup_short);
|
||||
}
|
||||
|
||||
#ifdef HAVE_VSERVER
|
||||
|
Reference in New Issue
Block a user