This is an automatic generated email to let you know that the following patch 
were queued at the 
http://git.linuxtv.org/xawtv3.git tree:

Subject: Fix a memory leak at drv0-v4l2
Author:  Dmitry Butskoy <[email protected]>
Date:    Wed Feb 2 15:53:09 2011 -0200

Patch imported from Debian Package

Signed-off-by: Mauro Carvalho Chehab <[email protected]>

 libng/plugins/drv0-v4l2.tmpl.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

---

http://git.linuxtv.org/xawtv3.git?a=commitdiff;h=26248798767cd373f6354a4c94b665f1dbf4de7c

diff --git a/libng/plugins/drv0-v4l2.tmpl.c b/libng/plugins/drv0-v4l2.tmpl.c
index 5c0c2d0..c11116e 100644
--- a/libng/plugins/drv0-v4l2.tmpl.c
+++ b/libng/plugins/drv0-v4l2.tmpl.c
@@ -550,7 +550,23 @@ v4l2_close_handle(void *handle)
 #else /* USE_LIBV4L */
     v4l2_close(h->fd);
 #endif /* USE_LIBV4L */
+
+    if (NULL != h->attr) {
+        int i;
+        for (i = 0; i < h->nattr; ++i) {
+          if ((NULL != h->attr[i].choices) &&
+              (stereo != h->attr[i].choices)) {
+                free(h->attr[i].choices);
+                h->attr[i].choices = NULL;
+            }
+        }
+        free(h->attr);
+        h->attr = NULL;
+    }
+
     free(h);
+    h = NULL;
+
     return 0;
 }
 

_______________________________________________
linuxtv-commits mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to