Author: zturner Date: Sat Nov 12 21:36:01 2016 New Revision: 286745 URL: http://llvm.org/viewvc/llvm-project?rev=286745&view=rev Log: Fix some use-after-frees that my last CL introduced.
Modified: lldb/trunk/include/lldb/Host/XML.h lldb/trunk/source/Host/common/XML.cpp Modified: lldb/trunk/include/lldb/Host/XML.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/XML.h?rev=286745&r1=286744&r2=286745&view=diff ============================================================================== --- lldb/trunk/include/lldb/Host/XML.h (original) +++ lldb/trunk/include/lldb/Host/XML.h Sat Nov 12 21:36:01 2016 @@ -139,7 +139,7 @@ public: //---------------------------------------------------------------------- XMLNode GetRootElement(const char *required_name = nullptr); - const std::string &GetErrors() const; + llvm::StringRef GetErrors() const; static void ErrorCallback(void *ctx, const char *format, ...); @@ -160,7 +160,7 @@ public: bool ParseFile(const char *path); - const std::string &GetErrors() const; + llvm::StringRef GetErrors() const; explicit operator bool() const { return IsValid(); } Modified: lldb/trunk/source/Host/common/XML.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/XML.cpp?rev=286745&r1=286744&r2=286745&view=diff ============================================================================== --- lldb/trunk/source/Host/common/XML.cpp (original) +++ lldb/trunk/source/Host/common/XML.cpp Sat Nov 12 21:36:01 2016 @@ -79,9 +79,7 @@ XMLNode XMLDocument::GetRootElement(cons return XMLNode(); } -const std::string &XMLDocument::GetErrors() const { - return m_errors.GetString(); -} +llvm::StringRef XMLDocument::GetErrors() const { return m_errors.GetString(); } bool XMLDocument::XMLEnabled() { #if defined(LIBXML2_DEFINED) @@ -391,7 +389,7 @@ ApplePropertyList::ApplePropertyList(con ApplePropertyList::~ApplePropertyList() {} -const std::string &ApplePropertyList::GetErrors() const { +llvm::StringRef ApplePropertyList::GetErrors() const { return m_xml_doc.GetErrors(); } _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits