Skip to content

Commit

Permalink
compiler: fix memory leak from unnecessary strdup (KhronosGroup#1761)
Browse files Browse the repository at this point in the history
The result of the `strdup` was never freed.  The string duplication
isn't necessary, so remove it.

Signed-off-by: Sven van Haastregt <[email protected]>
  • Loading branch information
svenvh committed Jun 22, 2023
1 parent 50f9f06 commit 2e88013
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test_conformance/compiler/test_compile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ int test_large_multiple_embedded_headers(cl_context context, cl_device_id device
header_names[i] = _strdup(buffer);

sprintf(buffer, composite_kernel_extern_template, i);
const char* line = _strdup(buffer);
const char *line = buffer;
error = create_single_kernel_helper_create_program(context, &headers[i], 1, &line);
if( headers[i] == NULL || error != CL_SUCCESS )
{
Expand Down

0 comments on commit 2e88013

Please sign in to comment.