summaryrefslogtreecommitdiffstats
path: root/sys/miscfs
diff options
context:
space:
mode:
authorsyl <syl@openbsd.org>2013-11-28 12:53:59 +0000
committersyl <syl@openbsd.org>2013-11-28 12:53:59 +0000
commit6ff6321205b97c20b14d3f86c35ec151fa879f2f (patch)
tree333c97e82700c6efdb2138b9a71b6149f2a95029 /sys/miscfs
parentfix loading of passphrase-protected keys. (diff)
downloadwireguard-openbsd-6ff6321205b97c20b14d3f86c35ec151fa879f2f.tar.xz
wireguard-openbsd-6ff6321205b97c20b14d3f86c35ec151fa879f2f.zip
Remove some double free on fusebuf datas.
Found the hard way and ok mpk@
Diffstat (limited to 'sys/miscfs')
-rw-r--r--sys/miscfs/fuse/fuse_device.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/miscfs/fuse/fuse_device.c b/sys/miscfs/fuse/fuse_device.c
index d223db10683..5b7874eaff6 100644
--- a/sys/miscfs/fuse/fuse_device.c
+++ b/sys/miscfs/fuse/fuse_device.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fuse_device.c,v 1.9 2013/10/07 18:25:32 syl Exp $ */
+/* $OpenBSD: fuse_device.c,v 1.10 2013/11/28 12:53:59 syl Exp $ */
/*
* Copyright (c) 2012-2013 Sylvestre Gallon <ccna.syl@gmail.com>
*
@@ -313,6 +313,7 @@ fuseioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p)
/* Adding fbuf in fd_fbufs_wait */
free(fbuf->fb_dat, M_FUSEFS);
+ fbuf->fb_dat = NULL;
SIMPLEQ_INSERT_TAIL(&fd->fd_fbufs_wait, fbuf, fb_next);
stat_fbufs_wait++;
break;
@@ -347,6 +348,7 @@ fuseioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p)
if (error) {
printf("fuse: Cannot copyin\n");
free(fbuf->fb_dat, M_FUSEFS);
+ fbuf->fb_dat = NULL;
return (error);
}