Delete the buffer in createObjectFile if it fails.
authorRafael Espindola <rafael.espindola@gmail.com>
Wed, 24 Jul 2013 14:00:26 +0000 (14:00 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Wed, 24 Jul 2013 14:00:26 +0000 (14:00 +0000)
commit4d76a21bc71fbba5e868036dd0d07f0b991d96a4
tree3c12f49b3a07fe28f1b4e11288c504e473d643f0
parent78bfe2b12ee1d0665a39c2ada1fad367fad8faed
Delete the buffer in createObjectFile if it fails.

The Binary constructor takes ownership of the memory buffer. This is a fairly
unfortunate interface, but for now make createObjectFile consistent with it
by also deleting the buffer if it fails.

Fixes a leak in llvm-ar found by the valgrind bots.

llvm-svn: 187039
llvm/lib/Object/ObjectFile.cpp