Release memory for cmdline when Process_updateCmdline() returns.

This closes a nasty memory leak. There is at least another leak looming somewhere when Disk I/O is shown in the header area. That could very well be an issue within libdevstat native to FreeBSD.
This commit is contained in:
Ximalas 2021-10-02 13:27:01 +02:00 committed by BenBE
parent 970885edc3
commit 9eb52d5932
1 changed files with 2 additions and 0 deletions

View File

@ -444,6 +444,8 @@ static void FreeBSDProcessList_updateProcessName(kvm_t* kd, const struct kinfo_p
*at = '\0'; *at = '\0';
Process_updateCmdline(proc, cmdline, 0, end); Process_updateCmdline(proc, cmdline, 0, end);
free(cmdline);
} }
static char* FreeBSDProcessList_readJailName(const struct kinfo_proc* kproc) { static char* FreeBSDProcessList_readJailName(const struct kinfo_proc* kproc) {