vlc | branch: master | Rémi Denis-Courmont <[email protected]> | Sun Oct  2 
13:55:15 2011 +0300| [895e45bd2aa5d61b01e5be6c7908225b796e0f59] | committer: 
Rémi Denis-Courmont

Fix unlikely memory leak

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

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

diff --git a/modules/access/v4l2/controls.c b/modules/access/v4l2/controls.c
index 9055f02..49db111 100644
--- a/modules/access/v4l2/controls.c
+++ b/modules/access/v4l2/controls.c
@@ -470,8 +470,10 @@ static vlc_v4l2_ctrl_t *ControlAddButton (vlc_object_t 
*obj, int fd,
         return NULL;
 
     if (var_Create (obj, c->name, VLC_VAR_VOID | VLC_VAR_ISCOMMAND))
+    {
+        free (c);
         return NULL;
-    (void) fd;
+    }
     return c;
 }
 

_______________________________________________
vlc-commits mailing list
[email protected]
http://mailman.videolan.org/listinfo/vlc-commits

Reply via email to