From 03f68f03065ca9c753b0cfb5e96c33abfdb49fbb Mon Sep 17 00:00:00 2001 From: Takashi Sakamoto Date: Sat, 13 Jun 2020 10:20:47 +0900 Subject: [PATCH] hwdep: fix leak of file descriptor in global methods of ALSAHwdep Fixes: 53d99ede2486 ("hwdep: add global method to get information of hwdep device") Signed-off-by: Takashi Sakamoto --- src/hwdep/query.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/hwdep/query.c b/src/hwdep/query.c index 5a615b1..abcf055 100644 --- a/src/hwdep/query.c +++ b/src/hwdep/query.c @@ -9,6 +9,7 @@ #include #include #include +#include #include @@ -353,6 +354,8 @@ static void hwdep_perform_ctl_ioctl(guint card_id, long request, void *data, if (ioctl(fd, request, data) < 0) generate_error(error, errno); + + close(fd); err_device: udev_device_unref(dev); err_ctx: -- 2.47.3