Skip to content

Commit bdd8092

Browse files
authored
video4linux2.c: do not close before open.
With no camera connected this would call close(0), causing problems later.
1 parent 4b7806a commit bdd8092

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

camera/drivers/video4linux2.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,8 @@ static void *v4l_init(const char *device, uint64_t caps,
310310
if (!path_is_character_special(v4l->dev_name))
311311
{
312312
RARCH_ERR("[V4L2]: %s is no device.\n", v4l->dev_name);
313-
goto error;
313+
free(v4l);
314+
return NULL;
314315
}
315316

316317
v4l->fd = open(v4l->dev_name, O_RDWR | O_NONBLOCK, 0);

0 commit comments

Comments
 (0)