Fix a memory leak in MachOObjectFile.
authorJim Grosbach <grosbach@apple.com>
Thu, 29 Nov 2012 19:14:11 +0000 (19:14 +0000)
committerJim Grosbach <grosbach@apple.com>
Thu, 29 Nov 2012 19:14:11 +0000 (19:14 +0000)
commit596e474101ea9a8ecac9d8ee090d31469dbcc61d
treeeec9884b2a00a762193158acf7994abd9b361b07
parent90d0e7e8be2dea641ca40ba86c14c08d429e5e76
Fix a memory leak in MachOObjectFile.

MachOObjectFile owns a MachOObj, but never frees it. Both MachOObjectFile
and MachOObj want to own the MemoryBuffer, though, so we have to be careful
and give them each one of their own.

Thanks to Greg Clayton, Eric Christopher and Michael Spencer for helping
figure out what's going wrong here.

rdar://12561773

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168923 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Object/MachO.h
lib/Object/MachOObjectFile.cpp