From 5410ab444c7220932d9d5e20f8b43cb992544cca Mon Sep 17 00:00:00 2001 From: gangatp Date: Fri, 8 Dec 2023 00:35:17 +0530 Subject: [PATCH] Revert "fixing memory leak in linux build" This reverts commit 2f06cbb930347127fcb355bc432b1b0988033889. --- .../NMR_ModelReaderNode_KeyStoreCEKParams.cpp | 7 +++---- .../NMR_ModelReaderNode_KeyStoreCipherValue.cpp | 3 +-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Source/Model/Reader/SecureContent101/NMR_ModelReaderNode_KeyStoreCEKParams.cpp b/Source/Model/Reader/SecureContent101/NMR_ModelReaderNode_KeyStoreCEKParams.cpp index f1e3149ed..23a75ee0f 100644 --- a/Source/Model/Reader/SecureContent101/NMR_ModelReaderNode_KeyStoreCEKParams.cpp +++ b/Source/Model/Reader/SecureContent101/NMR_ModelReaderNode_KeyStoreCEKParams.cpp @@ -44,7 +44,6 @@ NMR_ModelReaderNode_KeyStoreCipherValue.h defines the Model Reader Node class th #include "Common/NMR_StringUtils.h" #include "base64.h" -#include namespace NMR { namespace ParserUtils { @@ -114,17 +113,17 @@ namespace NMR { PModelReaderNode_StringValue pXMLNode = std::make_shared(m_pWarnings); pXMLNode->parseXML(pXMLReader); std::string result = base64_decode(pXMLNode->getValue()); - std::copy(result.begin(), result.end(), std::back_inserter(m_iv)); + m_iv = std::vector(result.begin(), result.end()); } else if (strcmp(pChildName, XML_3MF_SECURE_CONTENT_TAG) == 0) { PModelReaderNode_StringValue pXMLNode = std::make_shared(m_pWarnings); pXMLNode->parseXML(pXMLReader); std::string result = base64_decode(pXMLNode->getValue()); - std::copy(result.begin(), result.end(), std::back_inserter(m_tag)); + m_tag = std::vector(result.begin(), result.end()); } else if (strcmp(pChildName, XML_3MF_SECURE_CONTENT_AAD) == 0) { PModelReaderNode_StringValue pXMLNode = std::make_shared(m_pWarnings); pXMLNode->parseXML(pXMLReader); std::string result = base64_decode(pXMLNode->getValue()); - std::copy(result.begin(), result.end(), std::back_inserter(m_aad)); + m_aad = std::vector(result.begin(), result.end()); } else { m_pWarnings->addWarning(NMR_ERROR_NAMESPACE_INVALID_ELEMENT, mrwInvalidOptionalValue); } diff --git a/Source/Model/Reader/SecureContent101/NMR_ModelReaderNode_KeyStoreCipherValue.cpp b/Source/Model/Reader/SecureContent101/NMR_ModelReaderNode_KeyStoreCipherValue.cpp index ef263ab74..e7a61218d 100644 --- a/Source/Model/Reader/SecureContent101/NMR_ModelReaderNode_KeyStoreCipherValue.cpp +++ b/Source/Model/Reader/SecureContent101/NMR_ModelReaderNode_KeyStoreCipherValue.cpp @@ -42,7 +42,6 @@ NMR_ModelReaderNode_KeyStoreCipherValue.h defines the Model Reader Node class th #include "Model/Reader/NMR_ModelReaderNode_StringValue.h" #include "base64.h" -#include namespace NMR { @@ -74,7 +73,7 @@ namespace NMR { pNode->parseXML(pXMLReader); try { std::string result = base64_decode(pNode->getValue()); - std::copy(result.begin(), result.end(), std::back_inserter(m_sCipherValue)); + m_sCipherValue = std::vector(result.begin(), result.end()); } catch (...) { // base64_decode throws an exception if the input is not valid base64