Re: [PATCH] Rudimentary support for mi_media_detect_type on FreeBSD.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 4/4/21 3:44 PM, Trenton Schulz wrote:
+#else // Not Linux
+	int fd = open(device, O_RDONLY);
+	if (fd >= 0) {
+		struct v4l2_capability caps;
+		if (ioctl(fd, VIDIOC_QUERYCAP, &caps) == 0) {

Hi,

You should close the "fd" before all returns, in this function. Else it might leak.

int error;
error = ioctl(fd ...);
close(fd);

if (error == 0) {
...

--HPS



[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux