Fix some use-after-frees that my last CL introduced.

llvm-svn: 286745
This commit is contained in:
Zachary Turner 2016-11-13 03:36:01 +00:00
parent aa5611f56d
commit 8927f23abd
2 changed files with 4 additions and 6 deletions

View File

@ -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(); }

View File

@ -79,9 +79,7 @@ XMLNode XMLDocument::GetRootElement(const char *required_name) {
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(const char *path)
ApplePropertyList::~ApplePropertyList() {}
const std::string &ApplePropertyList::GetErrors() const {
llvm::StringRef ApplePropertyList::GetErrors() const {
return m_xml_doc.GetErrors();
}