aboutsummaryrefslogtreecommitdiffstats
path: root/libdash
diff options
context:
space:
mode:
authorAngelo Mantellini <angelo.mantellini@cisco.com>2020-02-10 14:24:20 +0100
committerAngelo Mantellini <angelo.mantellini@cisco.com>2020-02-10 14:40:21 +0100
commitd1f1d938930b6b473bedf3736fc675d5c4c3ee9a (patch)
tree8695f5d9105fad8f08f39ecb7ce7046d8e85ccb9 /libdash
parent0b2f5c75cfeb33b233c02866e848e3d94de48ee7 (diff)
Correction adaptech and minor corrections + remove memory leak libdash
Signed-off-by: Angelo Mantellini <angelo.mantellini@cisco.com> Change-Id: I83161f19385a5ed739e9fd280925abca8009dc71 Change-Id: If394f999b7325a6b07ddff57201f7657e58a493c Signed-off-by: Angelo Mantellini <angelo.mantellini@cisco.com>
Diffstat (limited to 'libdash')
-rw-r--r--libdash/source/mpd/MPD.cpp3
-rw-r--r--libdash/source/xml/DOMParser.cpp5
2 files changed, 6 insertions, 2 deletions
diff --git a/libdash/source/mpd/MPD.cpp b/libdash/source/mpd/MPD.cpp
index 0c4f2f3a..8563ef07 100644
--- a/libdash/source/mpd/MPD.cpp
+++ b/libdash/source/mpd/MPD.cpp
@@ -27,6 +27,7 @@ MPD::MPD () :
maxSegmentDuration(""),
maxSubsegmentDuration("")
{
+ this->mpdPathBaseUrl = NULL;
}
MPD::~MPD ()
{
@@ -38,6 +39,8 @@ MPD::~MPD ()
delete(this->periods.at(i));
for(size_t i = 0; i < this->baseUrls.size(); i++)
delete(this->baseUrls.at(i));
+ if (this->mpdPathBaseUrl)
+ delete(this->mpdPathBaseUrl);
}
const std::vector<IProgramInformation *>& MPD::GetProgramInformations () const
diff --git a/libdash/source/xml/DOMParser.cpp b/libdash/source/xml/DOMParser.cpp
index 5feb3850..c4fd2fb2 100644
--- a/libdash/source/xml/DOMParser.cpp
+++ b/libdash/source/xml/DOMParser.cpp
@@ -41,11 +41,11 @@ bool DOMParser::Parse (std::string path)
if(xmlTextReaderRead(this->reader))
this->root = this->ProcessNode(path);
+ xmlFreeTextReader(this->reader);
+
if(this->root == NULL)
return false;
- xmlFreeTextReader(this->reader);
-
return true;
}
Node* DOMParser::ProcessNode (std::string path)
@@ -110,6 +110,7 @@ Node* DOMParser::ProcessNode (std::string path)
Node *node = new Node();
node->SetType(type);
node->SetText(text);
+ delete text;
return node;
}
}