Index: lldb/trunk/source/Host/freebsd/HostInfoFreeBSD.cpp =================================================================== --- lldb/trunk/source/Host/freebsd/HostInfoFreeBSD.cpp +++ lldb/trunk/source/Host/freebsd/HostInfoFreeBSD.cpp @@ -64,13 +64,10 @@ static FileSpec g_program_filespec; if (!g_program_filespec) { int exe_path_mib[4] = {CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, getpid()}; - size_t exe_path_size; - if (sysctl(exe_path_mib, 4, NULL, &exe_path_size, NULL, 0) == 0) { - char *exe_path = new char[exe_path_size]; - if (sysctl(exe_path_mib, 4, exe_path, &exe_path_size, NULL, 0) == 0) - g_program_filespec.SetFile(exe_path, FileSpec::Style::native); - delete[] exe_path; - } + char exe_path[PATH_MAX]; + size_t exe_path_size = sizeof(exe_path); + if (sysctl(exe_path_mib, 4, exe_path, &exe_path_size, NULL, 0) == 0) + g_program_filespec.SetFile(exe_path, false); } return g_program_filespec; }