From 2e88013b34586c10fb8cc9eb0320e5587ce94785 Mon Sep 17 00:00:00 2001 From: Sven van Haastregt Date: Thu, 22 Jun 2023 06:08:21 +0100 Subject: [PATCH] compiler: fix memory leak from unnecessary strdup (#1761) The result of the `strdup` was never freed. The string duplication isn't necessary, so remove it. Signed-off-by: Sven van Haastregt --- test_conformance/compiler/test_compile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test_conformance/compiler/test_compile.cpp b/test_conformance/compiler/test_compile.cpp index f3ee431224..d250bdd477 100644 --- a/test_conformance/compiler/test_compile.cpp +++ b/test_conformance/compiler/test_compile.cpp @@ -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 ) {