[scan-build] Undefined allocation of 0 bytes x2
@@ -80,6 +80,7 @@ soclCreateProgramWithSource(cl_context context,
*errcode_ret = CL_SUCCESS;
device_count = starpu_opencl_worker_get_count();
+ assert(device_count > 0);
DEBUG_MSG("Worker count: %d\n", device_count);
/* Check arguments */
@@ -58,8 +58,11 @@ void command_queue_dependencies_implicit(
* Return dependencies
*********************/
- cl_event * evs = malloc(ndeps * sizeof(cl_event));
int n = 0;
+ cl_event * evs = NULL;
+ if (ndeps > 0)
+ evs = malloc(ndeps * sizeof(cl_event));
+
/* Add dependency to last barrier if applicable */
if (cq->barrier != NULL)