diff options
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_sysctl.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c index 6334d06..ae724b7 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -231,7 +231,11 @@ sysctl(struct sysctl_args *args) memcpy(args->oldp, &tmp_int, oldlen); } - return (len > oldlen) ? -ENOMEM : 0; + if (args->oldlenp != NULL && len > oldlen) { + return -ENOMEM; + } + + return 0; } scret_t |