X-Git-Url: http://www.project-moonshot.org/gitweb/?p=shibboleth%2Fcpp-opensaml.git;a=blobdiff_plain;f=saml%2Fsaml2%2Fbinding%2Fimpl%2FSAML2ECPEncoder.cpp;h=12a9b4f9fd5e265f6a4e159d75aecf6f66922af8;hp=f2e8d19ae6731bb2b3da0f1d41a5c9cf9475fb12;hb=1462057b3b9ae7e165d34d988e30b14c213672ca;hpb=f1208cd2f514700244816377443c4951dc22c848 diff --git a/saml/saml2/binding/impl/SAML2ECPEncoder.cpp b/saml/saml2/binding/impl/SAML2ECPEncoder.cpp index f2e8d19..12a9b4f 100644 --- a/saml/saml2/binding/impl/SAML2ECPEncoder.cpp +++ b/saml/saml2/binding/impl/SAML2ECPEncoder.cpp @@ -59,13 +59,12 @@ namespace opensaml { { public: SAML2ECPEncoder(const DOMElement* e, const XMLCh* ns) : m_actor("http://schemas.xmlsoap.org/soap/actor/next"), - m_providerName(e ? e->getAttributeNS(ns, ProviderName) : nullptr), m_idpList(nullptr) { + m_providerName(e ? e->getAttributeNS(ns, ProviderName) : nullptr) { DOMElement* child = e ? XMLHelper::getFirstChildElement(e, SAML20P_NS, IDPList::LOCAL_NAME) : nullptr; if (child) - m_idpList = dynamic_cast(XMLObjectBuilder::buildOneFromElement(child)); + m_idpList.reset(dynamic_cast(XMLObjectBuilder::buildOneFromElement(child))); } virtual ~SAML2ECPEncoder() { - delete m_idpList; } const XMLCh* getProtocolFamily() const { @@ -87,7 +86,7 @@ namespace opensaml { private: auto_ptr_XMLCh m_actor; const XMLCh* m_providerName; - IDPList* m_idpList; + auto_ptr m_idpList; AnyElementBuilder m_anyBuilder; }; @@ -113,7 +112,7 @@ long SAML2ECPEncoder::encode( #ifdef _DEBUG xmltooling::NDC ndc("encode"); #endif - Category& log = Category::getInstance(SAML_LOGCAT".MessageEncoder.SAML2ECP"); + Category& log = Category::getInstance(SAML_LOGCAT ".MessageEncoder.SAML2ECP"); log.debug("validating input"); if (xmlObject->getParent()) @@ -176,7 +175,7 @@ long SAML2ECPEncoder::encode( hdrblock->getUnknownXMLObjects().push_back(request->getIssuer()->clone()); if (request->getScoping() && request->getScoping()->getIDPList()) hdrblock->getUnknownXMLObjects().push_back(request->getScoping()->getIDPList()->clone()); - else if (m_idpList) + else if (m_idpList.get()) hdrblock->getUnknownXMLObjects().push_back(m_idpList->clone()); header->getUnknownXMLObjects().push_back(hdrblock); }