diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2017-05-31 04:18:59 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2017-05-31 04:18:59 +0000 |
commit | c30f4ed611647700a4aa1428fe6073a65d908cc8 (patch) | |
tree | f4ac49ee58e396b32ff1e6fd1f71ad1733388635 /usr.bin | |
parent | 37b94d933a80c5f2c7c38e1e2e9ecdb2ba10ef25 (diff) |
close fd on an exit path
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/audioctl/audioctl.c | 6 |
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) |