summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorphilip <philip@FreeBSD.org>2007-12-05 19:32:59 +0000
committerphilip <philip@FreeBSD.org>2007-12-05 19:32:59 +0000
commitf6fdf45e349b11ad9b304a3fc758497a2920a4bf (patch)
treee0fa32b3e7f3266ca8037d979ab0d93f3af0cfd0 /sys
parentc2ee5917b0914026950465c0d4da515901da2989 (diff)
downloadFreeBSD-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.c3
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 */
OpenPOWER on IntegriCloud