mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-15 06:29:05 +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:
@@ -419,17 +419,15 @@ static ld_plugin_status all_symbols_read_hook(void) {
|
|||||||
(*message)(LDPL_ERROR, "%s", ErrMsg.c_str());
|
(*message)(LDPL_ERROR, "%s", ErrMsg.c_str());
|
||||||
return LDPS_ERR;
|
return LDPS_ERR;
|
||||||
}
|
}
|
||||||
raw_fd_ostream *objFile =
|
raw_fd_ostream objFile(uniqueObjPath.c_str(), ErrMsg,
|
||||||
new raw_fd_ostream(uniqueObjPath.c_str(), ErrMsg,
|
|
||||||
raw_fd_ostream::F_Binary);
|
raw_fd_ostream::F_Binary);
|
||||||
if (!ErrMsg.empty()) {
|
if (!ErrMsg.empty()) {
|
||||||
delete objFile;
|
|
||||||
(*message)(LDPL_ERROR, "%s", ErrMsg.c_str());
|
(*message)(LDPL_ERROR, "%s", ErrMsg.c_str());
|
||||||
return LDPS_ERR;
|
return LDPS_ERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
objFile->write(buffer, bufsize);
|
objFile.write(buffer, bufsize);
|
||||||
objFile->close();
|
objFile.close();
|
||||||
|
|
||||||
lto_codegen_dispose(cg);
|
lto_codegen_dispose(cg);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user