diff options
Diffstat (limited to 'sys/kern/sys_generic.c')
-rw-r--r-- | sys/kern/sys_generic.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c index cab79b8..841b8e0 100644 --- a/sys/kern/sys_generic.c +++ b/sys/kern/sys_generic.c @@ -565,7 +565,8 @@ ioctl(struct thread *td, struct ioctl_args *uap) if (com & IOC_IN) { error = copyin(uap->data, data, (u_int)size); if (error) { - free(data, M_IOCTLOPS); + if (size > 0) + free(data, M_IOCTLOPS); return (error); } } else if (com & IOC_OUT) { |