cl-api-create-program-with-binary: Match variable type in calloc.

Submitted by Vinson Lee on Dec. 20, 2014, 8:30 a.m.

Details

Message ID 1419064227-26408-1-git-send-email-vlee@freedesktop.org
State New
Headers show

Not browsing as part of any series.

Commit Message

Vinson Lee Dec. 20, 2014, 8:30 a.m.
Fix Clang Static Analyzer "Allocator sizeof operand mismatch" bug.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
---
 tests/cl/api/create-program-with-binary.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/tests/cl/api/create-program-with-binary.c b/tests/cl/api/create-program-with-binary.c
index 4873b76..55457d9 100644
--- a/tests/cl/api/create-program-with-binary.c
+++ b/tests/cl/api/create-program-with-binary.c
@@ -101,7 +101,7 @@  static cl_program create_binary_program(const piglit_cl_context ctx)
 		goto free_sizes;
 	}
 
-	binaries = calloc(sizeof(char*),  ctx->num_devices);
+	binaries = calloc(sizeof(unsigned char*),  ctx->num_devices);
 	for (i = 0; i < ctx->num_devices; i++) {
 		binaries[i] = malloc(sizes[i]);
 	}