]> git.alsa-project.org Git - alsa-gobject.git/commitdiff
hwdep: fix leak of file descriptor in global methods of ALSAHwdep
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Sat, 13 Jun 2020 01:20:47 +0000 (10:20 +0900)
committer坂本 貴史 <o-takashi@sakamocchi.jp>
Sat, 13 Jun 2020 01:34:33 +0000 (10:34 +0900)
Fixes: 53d99ede2486 ("hwdep: add global method to get information of hwdep device")
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
src/hwdep/query.c

index 5a615b1aa9ad4218a412e6be8b256ef02c140448..abcf0556c699457067042887c72d732728058fa6 100644 (file)
@@ -9,6 +9,7 @@
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <sys/ioctl.h>
+#include <unistd.h>
 
 #include <libudev.h>
 
@@ -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: