commit | e9c8bd76f484147cf8ed7793226846458bf1d2aa | [log] [tgz] |
---|---|---|
author | Nicolas Capens <capn@google.com> | Thu Jul 20 09:53:31 2017 -0400 |
committer | Nicolas Capens <nicolascapens@google.com> | Thu Jul 20 15:37:03 2017 +0000 |
tree | 11ca4c4159b3e862266133c7b16bc3f10d685f26 | |
parent | 75a6185ae44bea0c703f8a24dc4feea671416b54 [diff] |
Fix file descriptor leak. Change-Id: Ie02591ba84ba8a4b204a2cb05179718e397e5c21 Reviewed-on: https://swiftshader-review.googlesource.com/10768 Tested-by: Nicolas Capens <nicolascapens@google.com> Reviewed-by: Alexis Hétu <sugoi@google.com>
diff --git a/src/OpenGL/libEGL/Display.cpp b/src/OpenGL/libEGL/Display.cpp index b08fa65..0ae67bd 100644 --- a/src/OpenGL/libEGL/Display.cpp +++ b/src/OpenGL/libEGL/Display.cpp
@@ -676,7 +676,10 @@ if(fd != -1) { struct fb_var_screeninfo info; - if(ioctl(fd, FBIOGET_VSCREENINFO, &info) >= 0) + int io = ioctl(fd, FBIOGET_VSCREENINFO, &info); + close(fd); + + if(io >= 0) { switch(info.bits_per_pixel) { @@ -716,8 +719,6 @@ UNIMPLEMENTED(); } } - - close(fd); } }