From d8c9158f35ab1fb5ca03fd534d910fd945323b51 Mon Sep 17 00:00:00 2001 From: jsg Date: Wed, 31 May 2017 04:18:58 +0000 Subject: [PATCH] close fd on an exit path --- usr.bin/audioctl/audioctl.c | 6 ++++-- 1 file 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 * @@ -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) -- 2.20.1