Skip to content

Commit

Permalink
Revert "fixing memory leak in linux build"
Browse files Browse the repository at this point in the history
This reverts commit 2f06cbb.
  • Loading branch information
gangatp committed Dec 7, 2023
1 parent 2f06cbb commit 5410ab4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ NMR_ModelReaderNode_KeyStoreCipherValue.h defines the Model Reader Node class th
#include "Common/NMR_StringUtils.h"

#include "base64.h"
#include <iterator>

namespace NMR {
namespace ParserUtils {
Expand Down Expand Up @@ -114,17 +113,17 @@ namespace NMR {
PModelReaderNode_StringValue pXMLNode = std::make_shared<CModelReaderNode_StringValue>(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<nfByte>(result.begin(), result.end());
} else if (strcmp(pChildName, XML_3MF_SECURE_CONTENT_TAG) == 0) {
PModelReaderNode_StringValue pXMLNode = std::make_shared<CModelReaderNode_StringValue>(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<nfByte>(result.begin(), result.end());
} else if (strcmp(pChildName, XML_3MF_SECURE_CONTENT_AAD) == 0) {
PModelReaderNode_StringValue pXMLNode = std::make_shared<CModelReaderNode_StringValue>(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<nfByte>(result.begin(), result.end());
} else {
m_pWarnings->addWarning(NMR_ERROR_NAMESPACE_INVALID_ELEMENT, mrwInvalidOptionalValue);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <iterator>

namespace NMR {

Expand Down Expand Up @@ -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<nfByte>(result.begin(), result.end());
}
catch (...) {
// base64_decode throws an exception if the input is not valid base64
Expand Down

0 comments on commit 5410ab4

Please sign in to comment.