Skip to content

Commit bbe1916

Browse files
committed
Fix posible segfault by returning NULL on error.
1 parent 388fc11 commit bbe1916

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/gpuarray_buffer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ gpukernel *gpukernel_init(gpucontext *ctx, unsigned int count,
162162
const char *fname, unsigned int numargs,
163163
const int *typecodes, int flags, int *ret,
164164
char **err_str) {
165-
gpukernel *res;
165+
gpukernel *res = NULL;
166166
int err;
167167
err = ctx->ops->kernel_alloc(&res, ctx, count, strings, lengths, fname,
168168
numargs, typecodes, flags, err_str);

0 commit comments

Comments
 (0)