diff options
author | philip <philip@FreeBSD.org> | 2007-12-05 19:32:59 +0000 |
---|---|---|
committer | philip <philip@FreeBSD.org> | 2007-12-05 19:32:59 +0000 |
commit | f6fdf45e349b11ad9b304a3fc758497a2920a4bf (patch) | |
tree | e0fa32b3e7f3266ca8037d979ab0d93f3af0cfd0 /sys | |
parent | c2ee5917b0914026950465c0d4da515901da2989 (diff) | |
download | FreeBSD-src-f6fdf45e349b11ad9b304a3fc758497a2920a4bf.zip FreeBSD-src-f6fdf45e349b11ad9b304a3fc758497a2920a4bf.tar.gz |
Fix a use-after-free.
Submitted by: Ilja van Sprundel <ilja -at- netric.org>
Reviewed by: secteam
MFC after: 1 day
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/utopia/utopia.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/sys/dev/utopia/utopia.c b/sys/dev/utopia/utopia.c index caac02e..a4e7331 100644 --- a/sys/dev/utopia/utopia.c +++ b/sys/dev/utopia/utopia.c @@ -444,10 +444,9 @@ utopia_sysctl_stats(SYSCTL_HANDLER_ARGS) UTP_UNLOCK(utp); error = SYSCTL_OUT(req, val, sizeof(utp->stats)); - free(val, M_TEMP); - if (error && req->newptr != NULL) bcopy(val, &utp->stats, sizeof(utp->stats)); + free(val, M_TEMP); /* ignore actual new value */ |