[vlc-commits] v4l2: fix memory leak on error

Rémi Denis-Courmont git at videolan.org
Thu Apr 12 22:01:50 CEST 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Apr 12 23:01:34 2012 +0300| [b01c0a1273834e762f68b0172ad095a39fffbf6b] | committer: Rémi Denis-Courmont

v4l2: fix memory leak on error

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

 modules/access/v4l2/demux.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/modules/access/v4l2/demux.c b/modules/access/v4l2/demux.c
index 58e287e..7cf3a51 100644
--- a/modules/access/v4l2/demux.c
+++ b/modules/access/v4l2/demux.c
@@ -457,7 +457,11 @@ static int InitVideo (demux_t *demux, int fd)
     }
 
     if (vlc_clone (&sys->thread, entry, demux, VLC_THREAD_PRIORITY_INPUT))
+    {
+        if (sys->bufv != NULL)
+            StopMmap (sys->fd, sys->bufv, sys->bufc);
         return -1;
+    }
     return 0;
 }
 



More information about the vlc-commits mailing list