mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-12 13:30:51 +00:00
Plug a leak in the non-error case by removing one level of indirection.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105556 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
66f360e990
commit
221aec60a7
@ -419,17 +419,15 @@ static ld_plugin_status all_symbols_read_hook(void) {
|
||||
(*message)(LDPL_ERROR, "%s", ErrMsg.c_str());
|
||||
return LDPS_ERR;
|
||||
}
|
||||
raw_fd_ostream *objFile =
|
||||
new raw_fd_ostream(uniqueObjPath.c_str(), ErrMsg,
|
||||
raw_fd_ostream::F_Binary);
|
||||
raw_fd_ostream objFile(uniqueObjPath.c_str(), ErrMsg,
|
||||
raw_fd_ostream::F_Binary);
|
||||
if (!ErrMsg.empty()) {
|
||||
delete objFile;
|
||||
(*message)(LDPL_ERROR, "%s", ErrMsg.c_str());
|
||||
return LDPS_ERR;
|
||||
}
|
||||
|
||||
objFile->write(buffer, bufsize);
|
||||
objFile->close();
|
||||
objFile.write(buffer, bufsize);
|
||||
objFile.close();
|
||||
|
||||
lto_codegen_dispose(cg);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user