diff options
author | Christian Goettsche <cgzones@googlemail.com> | 2020-12-05 20:34:23 +0100 |
---|---|---|
committer | Christian Goettsche <cgzones@googlemail.com> | 2020-12-05 20:34:23 +0100 |
commit | 8d1595a20e2a23fd1afc52c667bd7943eaa89b67 (patch) | |
tree | 03ea17535368a99387fe8ef7ee48b3e612d7be2d /freebsd/Platform.c | |
parent | 876194492fc4ed2dfb16f7a3f7e46bb46e5303fc (diff) |
FreeBSD: fix crash on empty environment
e.g. on kernel threads
Diffstat (limited to 'freebsd/Platform.c')
-rw-r--r-- | freebsd/Platform.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/freebsd/Platform.c b/freebsd/Platform.c index 506cafb4..bc77cf46 100644 --- a/freebsd/Platform.c +++ b/freebsd/Platform.c @@ -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; } |