[Beignet] [PATCH 1/5] Fix a bug of free all_dev when create context.

junyan.he at inbox.com junyan.he at inbox.com
Thu Oct 13 08:40:53 UTC 2016


From: Junyan He <junyan.he at intel.com>

---
 src/cl_context.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/cl_context.c b/src/cl_context.c
index e2ee4c0..378f4c3 100644
--- a/src/cl_context.c
+++ b/src/cl_context.c
@@ -358,6 +358,7 @@ cl_create_context(const cl_context_properties *  properties,
   ctx = cl_context_new(&props, properties, prop_len, dev_num, all_dev);
   if (ctx == NULL) {
     *errcode_ret = CL_OUT_OF_HOST_MEMORY;
+    cl_free(all_dev);
     return NULL;
   }
   /* cl_context_new will use all_dev. */
-- 
2.7.4





More information about the Beignet mailing list