From: jsg Date: Wed, 31 May 2017 04:18:58 +0000 (+0000) Subject: close fd on an exit path X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=d8c9158f35ab1fb5ca03fd534d910fd945323b51;p=openbsd close fd on an exit path --- 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)