summaryrefslogtreecommitdiffstats
path: root/lldb/source/Host/common/Host.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Host/common/Host.cpp')
-rw-r--r--lldb/source/Host/common/Host.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/lldb/source/Host/common/Host.cpp b/lldb/source/Host/common/Host.cpp
index 1db6d217f65..5755aa72c6d 100644
--- a/lldb/source/Host/common/Host.cpp
+++ b/lldb/source/Host/common/Host.cpp
@@ -630,9 +630,10 @@ Host::GetProgramFileSpec ()
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, false);
+ 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, false);
+ delete[] exe_path;
}
#endif
}
OpenPOWER on IntegriCloud