[vlc-devel] [PATCH] input/input: fix leak of seekpoints related to bookmarks

Filip Roséen filip at atch.se
Thu May 18 14:46:07 CEST 2017


As clean-up of these resources were missing, we would leak memory each
time we had an input with bookmarks attached.

fixes: #18339
---
 src/input/input.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/input/input.c b/src/input/input.c
index 596317391a..53398579b0 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -1503,6 +1503,12 @@ do { \
         free( priv->attachment_demux);
         priv->attachment_demux = NULL;
     }
+
+    /* clean bookmarks */
+    for( int i = 0; i < priv->i_bookmark; ++i )
+        vlc_seekpoint_Delete( priv->pp_bookmark[i] );
+    TAB_CLEAN( priv->i_bookmark, priv->pp_bookmark );
+
     vlc_mutex_unlock( &input_priv(p_input)->p_item->lock );
 
     /* */
-- 
2.12.2


More information about the vlc-devel mailing list