summaryrefslogtreecommitdiff
path: root/src/vaapi-recorder.c
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2013-10-09 13:48:09 -0700
committerKristian Høgsberg <krh@bitplanet.net>2013-10-10 16:50:18 -0700
commita2e20c369bf7cfed45eaeb0dd1fcca62526c1797 (patch)
tree7f217f786e65f3289ca5edff3d0846190178aed7 /src/vaapi-recorder.c
parent3b7d841b7e3107d720324444a117905e04925500 (diff)
downloadweston-a2e20c369bf7cfed45eaeb0dd1fcca62526c1797.tar.gz
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.
Diffstat (limited to 'src/vaapi-recorder.c')
-rw-r--r--src/vaapi-recorder.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/vaapi-recorder.c b/src/vaapi-recorder.c
index 84848e42..41314071 100644
--- a/src/vaapi-recorder.c
+++ b/src/vaapi-recorder.c
@@ -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;