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

Filip Roséen git at videolan.org
Thu May 18 18:21:26 CEST 2017


vlc | branch: master | Filip Roséen <filip at atch.se> | Thu May 18 14:46:07 2017 +0200| [472b9d40d389c7894dd30d7657d60557a6c1e340] | committer: Rémi Denis-Courmont

input/input: fix leak of seekpoints related to bookmarks

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

fixes: #18339

Signed-off-by: Rémi Denis-Courmont <remi at remlab.net>

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

 src/input/input.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/input/input.c b/src/input/input.c
index d4ddf28b2c..ddc638e529 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 );
 
     /* */



More information about the vlc-commits mailing list