Commit 39f55bbf authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

udev: fix unlikely descriptor leak

parent 5c6c8da6
...@@ -535,8 +535,9 @@ static char *disc_get_mrl (struct udev_device *dev) ...@@ -535,8 +535,9 @@ static char *disc_get_mrl (struct udev_device *dev)
val = udev_device_get_property_value (dev, "ID_CDROM_MEDIA_STATE"); val = udev_device_get_property_value (dev, "ID_CDROM_MEDIA_STATE");
if (val == NULL) if (val == NULL)
{ /* Force probing of the disc in the drive if any. */ { /* Force probing of the disc in the drive if any. */
int fd = open (node, O_RDONLY); int fd = open (node, O_RDONLY|O_CLOEXEC);
close (fd); if (fd != -1)
close (fd);
return NULL; return NULL;
} }
if (!strcmp (val, "blank")) if (!strcmp (val, "blank"))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment