[libbluray-devel] meta_parse: fixed leaking memory and file descriptors

hpi1 git at videolan.org
Mon Jan 21 13:02:35 CET 2013


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Mon Jan 21 13:32:10 2013 +0200| [05584179279dc6fe49c6fea96cd9788771f5762f] | committer: hpi1

meta_parse: fixed leaking memory and file descriptors

> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=05584179279dc6fe49c6fea96cd9788771f5762f
---

 src/libbluray/bdnav/meta_parse.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/libbluray/bdnav/meta_parse.c b/src/libbluray/bdnav/meta_parse.c
index 6bf44dc..e47784e 100644
--- a/src/libbluray/bdnav/meta_parse.c
+++ b/src/libbluray/bdnav/meta_parse.c
@@ -170,10 +170,7 @@ META_ROOT *meta_parse(const char *device_path)
             doc = xmlReadMemory((char*)data, (int)size, base, NULL, 0);
             if (doc == NULL) {
                 BD_DEBUG(DBG_DIR, "Failed to parse %s\n", path);
-                X_FREE(path);
-                X_FREE(base);
-                continue;
-            }
+            } else {
             xmlNode *root_element = NULL;
             root_element = xmlDocGetRootElement(doc);
             root->dl_entries[i].di_name = root->dl_entries[i].di_alternative = NULL;
@@ -184,6 +181,7 @@ META_ROOT *meta_parse(const char *device_path)
             _parseManifestNode(root_element, &root->dl_entries[i]);
             xmlFreeDoc(doc);
             }
+            }
             X_FREE(data);
         }
         file_close(handle);



More information about the libbluray-devel mailing list