diff options
author | Chris Lattner <sabre@nondot.org> | 2004-11-15 21:55:33 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-11-15 21:55:33 +0000 |
commit | 3bdad6923eae8ce356ce9392e96707064fdf1bc3 (patch) | |
tree | 584f768ceff45f382252faffa576d4788018fb8a /lib/Bytecode | |
parent | 1992522abd2742ca1cbf24ceec8a6020c6fbc248 (diff) |
Make *SURE* to null out the pointer before throwing an exception, otherwise
the dtor for the BytecodeReader class will try to free it again!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17856 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bytecode')
-rw-r--r-- | lib/Bytecode/Reader/Reader.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/Bytecode/Reader/Reader.cpp b/lib/Bytecode/Reader/Reader.cpp index 65d4c1c15d..6743bc8da0 100644 --- a/lib/Bytecode/Reader/Reader.cpp +++ b/lib/Bytecode/Reader/Reader.cpp @@ -2240,8 +2240,10 @@ void BytecodeReader::ParseBytecode(BufPtr Buf, unsigned Length, freeState(); delete TheModule; TheModule = 0; - if (decompressedBlock != 0 ) + if (decompressedBlock != 0 ) { ::free(decompressedBlock); + decompressedBlock = 0; + } throw; } catch (...) { std::string msg("Unknown Exception Occurred"); @@ -2249,8 +2251,10 @@ void BytecodeReader::ParseBytecode(BufPtr Buf, unsigned Length, freeState(); delete TheModule; TheModule = 0; - if (decompressedBlock != 0 ) + if (decompressedBlock != 0) { ::free(decompressedBlock); + decompressedBlock = 0; + } throw msg; } } |