From 48180b697b962fea855c54bbdc425829bf7f58aa Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Thu, 25 Aug 2011 13:10:53 +1000 Subject: [PATCH] Fail gracefully if unable to open the opencl files. --- ocl.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ocl.c b/ocl.c index cb95994c..9c861619 100644 --- a/ocl.c +++ b/ocl.c @@ -367,6 +367,9 @@ _clState *initCl(unsigned int gpu, char *name, size_t nameSize) char *source, *rawsource = file_contents(filename, &pl); size_t sourceSize[] = {(size_t)pl}; + if (!rawsource) + return NULL; + source = malloc(pl); if (!source) { applog(LOG_ERR, "Unable to malloc source");