From: Takashi Sakamoto Date: Sat, 13 Jun 2020 01:20:47 +0000 (+0900) Subject: hwdep: fix leak of file descriptor in global methods of ALSAHwdep X-Git-Tag: v0.1.0~63 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=03f68f03065ca9c753b0cfb5e96c33abfdb49fbb;p=alsa-gobject.git 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 --- 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: