From 50cc9cd456a2ddd33cb1ece9b811dbf4852a2e67 Mon Sep 17 00:00:00 2001 From: Marco Randazzo Date: Wed, 29 Nov 2023 11:08:48 +0100 Subject: [PATCH] valgrind fix --- .../src/yarp/robotinterface/XMLReader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libYARP_robotinterface/src/yarp/robotinterface/XMLReader.cpp b/src/libYARP_robotinterface/src/yarp/robotinterface/XMLReader.cpp index 25a5dfeb7b1..612fdbe7b4a 100644 --- a/src/libYARP_robotinterface/src/yarp/robotinterface/XMLReader.cpp +++ b/src/libYARP_robotinterface/src/yarp/robotinterface/XMLReader.cpp @@ -82,7 +82,7 @@ yarp::robotinterface::XMLReaderResult yarp::robotinterface::XMLReader::getRobotF std::string path = filename.substr(0, filename.rfind(yarp::conf::filesystem::preferred_separator)); yDebug() << "Reading file" << filename.c_str(); - auto* doc = new TiXmlDocument(filename.c_str()); + auto doc = std::make_unique< TiXmlDocument>(TiXmlDocument(filename.c_str())); if (!doc->LoadFile()) { SYNTAX_ERROR(doc->ErrorRow()) << doc->ErrorDesc(); return yarp::robotinterface::XMLReaderResult::ParsingFailed();