summaryrefslogtreecommitdiffstats
path: root/usr.bin/audioctl
diff options
context:
space:
mode:
authorjsg <jsg@openbsd.org>2017-05-31 04:18:58 +0000
committerjsg <jsg@openbsd.org>2017-05-31 04:18:58 +0000
commitd8c9158f35ab1fb5ca03fd534d910fd945323b51 (patch)
tree1f95376b577c937e9260244eb3b43a2576cfa446 /usr.bin/audioctl
parentone more void *ctx => struct ssh *ssh conversion (diff)
downloadwireguard-openbsd-d8c9158f35ab1fb5ca03fd534d910fd945323b51.tar.xz
wireguard-openbsd-d8c9158f35ab1fb5ca03fd534d910fd945323b51.zip
close fd on an exit path
Diffstat (limited to 'usr.bin/audioctl')
-rw-r--r--usr.bin/audioctl/audioctl.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/audioctl/audioctl.c b/usr.bin/audioctl/audioctl.c
index 22f0078a69e..bbc035a8dbd 100644
--- a/usr.bin/audioctl/audioctl.c
+++ b/usr.bin/audioctl/audioctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: audioctl.c,v 1.34 2016/08/31 09:48:26 jsg Exp $ */
+/* $OpenBSD: audioctl.c,v 1.35 2017/05/31 04:18:58 jsg Exp $ */
/*
* Copyright (c) 2016 Alexandre Ratchov <alex@caoua.org>
*
@@ -260,8 +260,10 @@ main(int argc, char **argv)
printf("\n");
}
}
- if (!set)
+ if (!set) {
+ close(fd);
return 0;
+ }
if (ioctl(fd, AUDIO_SETPAR, &wpar) < 0)
err(1, "AUDIO_SETPAR");
if (ioctl(fd, AUDIO_GETPAR, &wpar) < 0)