From da37358ab4c2e0355f1b911b2e1b8a0275a5c997 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nagy-Egri=20M=C3=A1t=C3=A9=20Ferenc?= Date: Tue, 7 Nov 2023 18:35:54 +0100 Subject: [PATCH] Simplify byte size calculation Co-authored-by: Ronan Keryell --- lib/src/Utils/File.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/Utils/File.c b/lib/src/Utils/File.c index 647d1d75..354a027a 100644 --- a/lib/src/Utils/File.c +++ b/lib/src/Utils/File.c @@ -389,7 +389,7 @@ char *cl_util_read_exe_relative_text_file(const char *const rel_path, cl_int err = CL_SUCCESS; size_t exe_folder_length; OCLERROR_RET(cl_util_executable_folder(NULL, &exe_folder_length), err, end); - MEM_CHECK(abs_path = (char *)malloc(sizeof(char) * exe_folder_length + MEM_CHECK(abs_path = (char *)malloc(exe_folder_length + strlen(rel_path) + 1), err, end); OCLERROR_RET(cl_util_executable_folder(abs_path, NULL), err, end);