diff --git a/bolt/runtime/instr.cpp b/bolt/runtime/instr.cpp index a42750cef6b6e..1f54a500dbf98 100644 --- a/bolt/runtime/instr.cpp +++ b/bolt/runtime/instr.cpp @@ -714,9 +714,11 @@ static char *getBinaryPath() { uint32_t Ret = __readlink(FindBuf, TargetPath, sizeof(TargetPath)); assert(Ret != -1 && Ret != BufSize, "readlink error"); TargetPath[Ret] = '\0'; + __close(FDdir); return TargetPath; } } + __close(FDdir); return nullptr; }