Commit 1e124d2c authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen Committed by Jean-Baptiste Kempf

dash: MPD manager factory: fixing a potential memory leak

Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
(cherry picked from commit 3852dd54)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent ebcf8a9b
......@@ -45,14 +45,12 @@ IMPDManager* MPDManagerFactory::create (Profile profile, Node *
IMPDManager* MPDManagerFactory::createBasicCMManager (Node *root)
{
BasicCMParser *parser = new BasicCMParser(root);
BasicCMParser parser(root);
if(!parser->parse())
if(!parser.parse())
return new NullManager();
BasicCMManager *manager = new BasicCMManager(parser->getMPD());
delete(parser);
BasicCMManager *manager = new BasicCMManager(parser.getMPD());
return manager;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment