diff options
author | Sylvestre Gallon <syl@cvs.openbsd.org> | 2013-11-28 12:54:00 +0000 |
---|---|---|
committer | Sylvestre Gallon <syl@cvs.openbsd.org> | 2013-11-28 12:54:00 +0000 |
commit | 19d017c28a2b4e3d999af0eac4c83907caa2bd5f (patch) | |
tree | 2b5c1f7ee216e74ab38717a274f0d453f1c2cd90 /sys | |
parent | 45157af4612cf5ad6cd825becacf55fafcabcf25 (diff) |
Remove some double free on fusebuf datas.
Found the hard way and ok mpk@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/miscfs/fuse/fuse_device.c | 4 |
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); } |