Stop freeing credential resolvers twice, when errors occur during initialization.
[shibboleth/cpp-sp.git] / xmlproviders / XMLCredentials.cpp
index 79c11b2..8e810c9 100644 (file)
 #include <sys/types.h>
 #include <sys/stat.h>
 
-#include <log4cpp/Category.hh>
-
+using namespace xmlproviders::logging;
 using namespace shibboleth;
 using namespace saml;
-using namespace log4cpp;
 using namespace std;
 
 namespace {
@@ -96,7 +94,7 @@ void XMLCredentialsImpl::init()
         DOMElement* child=saml::XML::getFirstChildElement(m_root);
         while (child) {
             string cr_type;
-            auto_ptr<char> id(XMLString::transcode(child->getAttributeNS(NULL,SHIB_L(Id))));
+            auto_ptr_char id(child->getAttributeNS(NULL,SHIB_L(Id)));
             
             if (saml::XML::isElementNamed(child,::XML::CREDS_NS,SHIB_L(FileResolver)))
                 cr_type="edu.internet2.middleware.shibboleth.common.Credentials.FileCredentialResolver";
@@ -130,14 +128,12 @@ void XMLCredentialsImpl::init()
         }
     }
     catch (SAMLException& e) {
-        log.errorStream() << "Error while parsing creds configuration: " << e.what() << CategoryStream::ENDLINE;
-        this->~XMLCredentialsImpl();
+        log.errorStream() << "Error while parsing creds configuration: " << e.what() << xmlproviders::logging::eol;
         throw;
     }
 #ifndef _DEBUG
     catch (...) {
         log.error("Unexpected error while parsing creds configuration");
-        this->~XMLCredentialsImpl();
         throw;
     }
 #endif