From 2125da5a0f590f734c70bc508621bbb5452c0977 Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Sat, 20 Jul 2013 21:00:47 +0000 Subject: [PATCH] [PECOFF] Fix use-after-free. llvm-svn: 186771 --- lld/lib/ReaderWriter/PECOFF/PECOFFTargetInfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lld/lib/ReaderWriter/PECOFF/PECOFFTargetInfo.cpp b/lld/lib/ReaderWriter/PECOFF/PECOFFTargetInfo.cpp index 8c23523..0d5a359 100644 --- a/lld/lib/ReaderWriter/PECOFF/PECOFFTargetInfo.cpp +++ b/lld/lib/ReaderWriter/PECOFF/PECOFFTargetInfo.cpp @@ -57,7 +57,7 @@ bool PECOFFTargetInfo::validateImpl(raw_ostream &diagnostics) { /// Append the given file to the input file list. The file must be an object /// file or an import library file. bool PECOFFTargetInfo::appendInputFileOrLibrary(std::string path) { - StringRef ext = llvm::sys::path::extension(path).lower(); + std::string ext = llvm::sys::path::extension(path).lower(); // This is an import library file. Look for the library file in the search // paths, unless the path contains a directory name. if (ext == ".lib") { -- 2.7.4