[libbluray-devel] Fixed leaks in meta_parse()

Ferdinand Holzer git at videolan.org
Fri Aug 17 12:53:24 CEST 2012


libbluray | branch: master | Ferdinand Holzer <holzer at grg21.ac.at> | Fri Aug 17 13:07:50 2012 +0300| [4f07f2228c87e47edf0fad7f79f0a18f944ff264] | committer: hpi1

Fixed leaks in meta_parse()

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

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

diff --git a/src/libbluray/bdnav/meta_parse.c b/src/libbluray/bdnav/meta_parse.c
index 21e3171..c12892a 100644
--- a/src/libbluray/bdnav/meta_parse.c
+++ b/src/libbluray/bdnav/meta_parse.c
@@ -145,6 +145,8 @@ META_ROOT *meta_parse(const char *device_path)
         BD_FILE_H *handle = file_open(path, "rb");
         if (handle == NULL) {
             BD_DEBUG(DBG_DIR, "Failed to open meta file (%s)\n", path);
+            X_FREE(path);
+            X_FREE(base);
             continue;
         }
 
@@ -158,6 +160,8 @@ META_ROOT *meta_parse(const char *device_path)
             doc = xmlReadMemory((char*)data, size_read, base, NULL, 0);
             if (doc == NULL) {
                 BD_DEBUG(DBG_DIR, "Failed to parse %s\n", path);
+                X_FREE(path);
+                X_FREE(base);
                 continue;
             }
             xmlNode *root_element = NULL;
@@ -172,6 +176,8 @@ META_ROOT *meta_parse(const char *device_path)
             X_FREE(data);
         }
         file_close(handle);
+        X_FREE(path);
+        X_FREE(base);
     }
     xmlCleanupParser();
     return root;



More information about the libbluray-devel mailing list