summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorratchov <ratchov@openbsd.org>2015-07-24 08:43:04 +0000
committerratchov <ratchov@openbsd.org>2015-07-24 08:43:04 +0000
commit59613df7a0aacabe1140913b730f34276a3a6bff (patch)
treef97068b0d8373cf3e8e1aef162d3c5de55dfff25
parentConvert tls1_process_ticket to CBS. (diff)
downloadwireguard-openbsd-59613df7a0aacabe1140913b730f34276a3a6bff.tar.xz
wireguard-openbsd-59613df7a0aacabe1140913b730f34276a3a6bff.zip
Clear watchdog timer when device is closed, fixes use-after-free in
error code-paths when device is closed before audio is stopped.
-rw-r--r--usr.bin/sndiod/siofile.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.bin/sndiod/siofile.c b/usr.bin/sndiod/siofile.c
index 7dee3a7d3cd..c1473cbcf69 100644
--- a/usr.bin/sndiod/siofile.c
+++ b/usr.bin/sndiod/siofile.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: siofile.c,v 1.6 2015/02/16 06:28:05 ratchov Exp $ */
+/* $OpenBSD: siofile.c,v 1.7 2015/07/24 08:43:04 ratchov Exp $ */
/*
* Copyright (c) 2008-2012 Alexandre Ratchov <alex@caoua.org>
*
@@ -228,6 +228,7 @@ dev_sio_close(struct dev *d)
log_puts(": closed\n");
}
#endif
+ timo_del(&d->sio.watchdog);
file_del(d->sio.file);
sio_close(d->sio.hdl);
}