summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmil Velikov <emil.l.velikov@gmail.com>2016-07-18 16:47:54 +0100
committerRob Herring <robh@kernel.org>2016-12-13 09:43:49 -0600
commit128f82753be877d41ddcfbbdc22630f19121ad89 (patch)
tree0eff3e54438a38435fc565ea6cded08ef4f5c65e
parent23751354706108e63d0bdeeda2e77fe55521ae31 (diff)
downloadgbm_gralloc-128f82753be877d41ddcfbbdc22630f19121ad89.tar.gz
gbm_gralloc-128f82753be877d41ddcfbbdc22630f19121ad89.tar.xz
Don't leak the FD in the gbm_dev_create error path
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
-rw-r--r--gralloc_gbm.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/gralloc_gbm.cpp b/gralloc_gbm.cpp
index 1ff3465..25cbf51 100644
--- a/gralloc_gbm.cpp
+++ b/gralloc_gbm.cpp
@@ -242,6 +242,7 @@ struct gbm_device *gbm_dev_create(void)
gbm = gbm_create_device(fd);
if (!gbm) {
ALOGE("failed to create gbm device");
+ close(fd);
}
return gbm;