Fix a memory leak in mpd compare code
This only affects unittests. Change-Id: I5deba5ce08c08970ec8b2de9ff5f6f7a7a5a436a
This commit is contained in:
parent
368e94941b
commit
0614caed83
|
@ -7,7 +7,7 @@
|
||||||
#include "packager/media/base/video_stream_info.h"
|
#include "packager/media/base/video_stream_info.h"
|
||||||
|
|
||||||
#include "base/logging.h"
|
#include "base/logging.h"
|
||||||
#include "base/stl_util.h"
|
#include "packager/base/stl_util.h"
|
||||||
#include "packager/base/strings/string_number_conversions.h"
|
#include "packager/base/strings/string_number_conversions.h"
|
||||||
#include "packager/base/strings/string_util.h"
|
#include "packager/base/strings/string_util.h"
|
||||||
#include "packager/base/strings/stringprintf.h"
|
#include "packager/base/strings/stringprintf.h"
|
||||||
|
|
|
@ -9,10 +9,10 @@
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
#include <libxml/xmlstring.h>
|
#include <libxml/xmlstring.h>
|
||||||
|
|
||||||
#include "base/strings/string_piece.h"
|
|
||||||
#include "packager/base/file_util.h"
|
#include "packager/base/file_util.h"
|
||||||
#include "packager/base/logging.h"
|
#include "packager/base/logging.h"
|
||||||
#include "packager/base/strings/string_number_conversions.h"
|
#include "packager/base/strings/string_number_conversions.h"
|
||||||
|
#include "packager/base/strings/string_piece.h"
|
||||||
#include "packager/base/strings/string_util.h"
|
#include "packager/base/strings/string_util.h"
|
||||||
#include "packager/base/strings/stringprintf.h"
|
#include "packager/base/strings/stringprintf.h"
|
||||||
#include "packager/media/file/file.h"
|
#include "packager/media/file/file.h"
|
||||||
|
|
|
@ -76,10 +76,12 @@ bool CompareNames(xmlNodePtr node1, xmlNodePtr node2) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CompareContents(xmlNodePtr node1, xmlNodePtr node2) {
|
bool CompareContents(xmlNodePtr node1, xmlNodePtr node2) {
|
||||||
|
xml::ScopedXmlPtr<xmlChar>::type node1_content_ptr(xmlNodeGetContent(node1));
|
||||||
|
xml::ScopedXmlPtr<xmlChar>::type node2_content_ptr(xmlNodeGetContent(node2));
|
||||||
std::string node1_content =
|
std::string node1_content =
|
||||||
reinterpret_cast<const char*>(xmlNodeGetContent(node1));
|
reinterpret_cast<const char*>(node1_content_ptr.get());
|
||||||
std::string node2_content =
|
std::string node2_content =
|
||||||
reinterpret_cast<const char*>(xmlNodeGetContent(node2));
|
reinterpret_cast<const char*>(node2_content_ptr.get());
|
||||||
base::ReplaceChars(node1_content, "\n", "", &node1_content);
|
base::ReplaceChars(node1_content, "\n", "", &node1_content);
|
||||||
base::TrimString(node1_content, " ", &node1_content);
|
base::TrimString(node1_content, " ", &node1_content);
|
||||||
base::ReplaceChars(node2_content, "\n", "", &node2_content);
|
base::ReplaceChars(node2_content, "\n", "", &node2_content);
|
||||||
|
|
Loading…
Reference in New Issue