projects
/
profile
/
ivi
/
weston-ivi-shell.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3b7d841
)
vaapi-recorder: Don't leak fd on thread error path
author
Kristian Høgsberg
<krh@bitplanet.net>
Wed, 9 Oct 2013 20:48:09 +0000
(13:48 -0700)
committer
Kristian Høgsberg
<krh@bitplanet.net>
Thu, 10 Oct 2013 23:50:18 +0000
(16:50 -0700)
If we successfully open the file but fail to create the thread we
leak the fd.
src/vaapi-recorder.c
patch
|
blob
|
history
diff --git
a/src/vaapi-recorder.c
b/src/vaapi-recorder.c
index
84848e4
..
4131407
100644
(file)
--- 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;