[PATCH] D13061: [Bug 21681] - Fixed: Memory leak in FileArchive::find()
George Rimar via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 24 03:07:57 PDT 2015
grimar added a comment.
If everything is ok now - could you please commit ? I dont have write permissions yet.
================
Comment at: ReaderWriter/ELF/OutputELFWriter.cpp:49-56
@@ -50,1 +48,10 @@
+
+ if (!_file->hasAtoms())
+ return nullptr;
+
+ // If atoms were added - return the file but also store it for later
+ // destruction.
+ File *result = _file.get();
+ _returnedFiles.push_back(std::move(_file));
+ return result;
}
----------------
Fixed.
Just please note that we should return nullptr if file does not have atoms.
http://reviews.llvm.org/D13061
More information about the llvm-commits
mailing list