mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-05-05 13:28:07 +02:00
vaapi-recorder: Don't leak fd on thread error path
If we successfully open the file but fail to create the thread we leak the fd.
This commit is contained in:
parent
3b7d841b7e
commit
a2e20c369b
1 changed files with 2 additions and 3 deletions
|
|
@ -944,12 +944,11 @@ vaapi_recorder_create(int drm_fd, int width, int height, const char *filename)
|
|||
r->height = height;
|
||||
r->drm_fd = drm_fd;
|
||||
|
||||
flags = O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC;
|
||||
r->output_fd = open(filename, flags, 0644);
|
||||
|
||||
if (setup_worker_thread(r) < 0)
|
||||
goto err_free;
|
||||
|
||||
flags = O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC;
|
||||
r->output_fd = open(filename, flags, 0644);
|
||||
if (r->output_fd < 0)
|
||||
goto err_thread;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue