mirror of
https://github.com/xzeldon/htop.git
synced 2024-12-26 07:45:45 +00:00
FreeBSD: fix crash on empty environment
e.g. on kernel threads
This commit is contained in:
parent
876194492f
commit
8d1595a20e
@ -248,7 +248,7 @@ char* Platform_getProcessEnv(pid_t pid) {
|
||||
char* env = xMalloc(capacity);
|
||||
|
||||
int err = sysctl(mib, 4, env, &capacity, NULL, 0);
|
||||
if (err) {
|
||||
if (err || capacity == 0) {
|
||||
free(env);
|
||||
return NULL;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user