Commit 3852dd54 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>
parent d4a1c6dc
...@@ -45,14 +45,12 @@ IMPDManager* MPDManagerFactory::create (Profile profile, Node * ...@@ -45,14 +45,12 @@ IMPDManager* MPDManagerFactory::create (Profile profile, Node *
IMPDManager* MPDManagerFactory::createBasicCMManager (Node *root) IMPDManager* MPDManagerFactory::createBasicCMManager (Node *root)
{ {
BasicCMParser *parser = new BasicCMParser(root); BasicCMParser parser(root);
if(!parser->parse()) if(!parser.parse())
return new NullManager(); return new NullManager();
BasicCMManager *manager = new BasicCMManager(parser->getMPD()); BasicCMManager *manager = new BasicCMManager(parser.getMPD());
delete(parser);
return manager; 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