[vlc-devel] [PATCH 1/2] input: fix a potential leak when reducing controls

Thomas Guillem thomas at gllm.fr
Fri Jun 10 15:27:32 CEST 2016


For now, there is no leaks since reduced controls don't have anything to release.
---
 src/input/input.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/input/input.c b/src/input/input.c
index 425815a..fe49b01 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -1604,6 +1604,12 @@ static inline int ControlPop( input_thread_t *p_input,
     /* */
     const int i_index = ControlGetReducedIndexLocked( p_input );
 
+    for( int i = 0; i < i_index; ++i )
+    {
+        /* Release Reduced controls */
+        ControlRelease( p_sys->control[i].i_type, p_sys->control[i].val );
+    }
+
     /* */
     *pi_type = p_sys->control[i_index].i_type;
     *p_val   = p_sys->control[i_index].val;
-- 
2.8.1



More information about the vlc-devel mailing list