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)
val = udev_device_get_property_value (dev, "ID_CDROM_MEDIA_STATE");
if (val == NULL)
{ /* Force probing of the disc in the drive if any. */
int fd = open (node, O_RDONLY);
close (fd);
int fd = open (node, O_RDONLY|O_CLOEXEC);
if (fd != -1)
close (fd);
return NULL;
}
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