[libdvdnav-devel] Fix memleak

Jean-Baptiste Kempf git at videolan.org
Thu Jul 31 19:45:41 CEST 2014


libdvdnav | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Thu Jul 31 19:41:33 2014 +0200| [cff9acbc59abec6de1f751a2763815e4c8f36cf3] | committer: Jean-Baptiste Kempf

Fix memleak

> http://git.videolan.org/gitweb.cgi/libdvdnav.git/?a=commit;h=cff9acbc59abec6de1f751a2763815e4c8f36cf3
---

 src/dvdnav.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/dvdnav.c b/src/dvdnav.c
index 9212eeb..6f32550 100644
--- a/src/dvdnav.c
+++ b/src/dvdnav.c
@@ -119,6 +119,8 @@ dvdnav_status_t dvdnav_free_dup(dvdnav_t *this) {
 
   pthread_mutex_destroy(&this->vm_lock);
 
+  free(this->path);
+
   /* We leave the final freeing of the entire structure to the cache,
    * because we don't know, if there are still buffers out in the wild,
    * that must return first. */
@@ -183,6 +185,7 @@ dvdnav_status_t dvdnav_open(dvdnav_t** dest, const char *path) {
 fail:
   pthread_mutex_destroy(&this->vm_lock);
   vm_free_vm(this->vm);
+  free(this->path);
   free(this);
   return DVDNAV_STATUS_ERR;
 }
@@ -209,6 +212,8 @@ dvdnav_status_t dvdnav_close(dvdnav_t *this) {
 
   pthread_mutex_destroy(&this->vm_lock);
 
+  free(this->path);
+
   /* We leave the final freeing of the entire structure to the cache,
    * because we don't know, if there are still buffers out in the wild,
    * that must return first. */



More information about the libdvdnav-devel mailing list