forked from OSchip/llvm-project
Plug a leak in the non-error case by removing one level of indirection.
llvm-svn: 105556
This commit is contained in:
parent
6201b991a2
commit
4ecf2cc5ea
|
@ -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 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