[vlc-devel] [PATCH] input/control: remove unnecessar memory allocation

Filip Roséen filip at atch.se
Wed Mar 1 09:52:05 CET 2017


We do not need to duplicate the input_title_t in question as we are
only reading from the source object. These changes also fixes a
memory-leak given that p_title was never freed.
---
 src/input/control.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/input/control.c b/src/input/control.c
index f4781eb1a5..ff6df4c2fe 100644
--- a/src/input/control.c
+++ b/src/input/control.c
@@ -399,7 +399,7 @@ int input_vaControl( input_thread_t *p_input, int i_query, va_list args )
                 return VLC_EGENERIC;
             }
 
-            input_title_t *p_title = vlc_input_title_Duplicate( priv->title[*pi_title_to_fetch] );
+            input_title_t *p_title = priv->title[*pi_title_to_fetch];
 
             /* set arg2 to the number of seekpoints we found */
             const int i_chapters = p_title->i_seekpoint;
-- 
2.12.0



More information about the vlc-devel mailing list