mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 10:42:39 +01:00
Do not leak the Mach host port in sys::getHostCPUName()
Patch by rsesek (Robert Sesek) llvm-svn: 341357
This commit is contained in:
parent
23c3e25f09
commit
1f4b30fef7
@ -1022,8 +1022,10 @@ StringRef sys::getHostCPUName() {
|
||||
mach_msg_type_number_t infoCount;
|
||||
|
||||
infoCount = HOST_BASIC_INFO_COUNT;
|
||||
host_info(mach_host_self(), HOST_BASIC_INFO, (host_info_t)&hostInfo,
|
||||
mach_port_t hostPort = mach_host_self();
|
||||
host_info(hostPort, HOST_BASIC_INFO, (host_info_t)&hostInfo,
|
||||
&infoCount);
|
||||
mach_port_deallocate(mach_task_self(), hostPort);
|
||||
|
||||
if (hostInfo.cpu_type != CPU_TYPE_POWERPC)
|
||||
return "generic";
|
||||
|
Loading…
Reference in New Issue
Block a user