diff options
| author | Greg Clayton <gclayton@apple.com> | 2011-01-13 01:27:55 +0000 |
|---|---|---|
| committer | Greg Clayton <gclayton@apple.com> | 2011-01-13 01:27:55 +0000 |
| commit | 87ff1acc0c97bcb075f64a8f3bcafb2287875245 (patch) | |
| tree | 18d70f430a83475abf676fc9b7e5ad75e48b515f | |
| parent | 984cb75b2b23e6c137d619efff7e17133a174856 (diff) | |
| download | bcm5719-llvm-87ff1acc0c97bcb075f64a8f3bcafb2287875245.tar.gz bcm5719-llvm-87ff1acc0c97bcb075f64a8f3bcafb2287875245.zip | |
Plug Free BSD memory leak.
llvm-svn: 123357
| -rw-r--r-- | lldb/source/Host/common/Host.cpp | 7 |
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 } |

