Permalink
Browse files

Don't leak a libxml2 document object when a parser error occurs.

  • Loading branch information...
1 parent c96f3e2 commit d7218c1857205a41e44158b5788a47f7042490e0 @mlundblad committed Jun 18, 2012
Showing with 7 additions and 5 deletions.
  1. +7 −5 src/file-utils.vala
View
@@ -65,11 +65,13 @@ namespace Tabler {
return null;
}
- var parser = new ArrangementParser ();
- var arrangement = parser.create_from_xml (root);
-
- delete doc;
- return arrangement;
+ try {
+ var parser = new ArrangementParser ();
+ var arrangement = parser.create_from_xml (root);
+ return arrangement;
+ } finally {
+ delete doc;
+ }
}
}

0 comments on commit d7218c1

Please sign in to comment.