[vlc-devel] [PATCH 1/2] vlm: fix dangling pointer and memory leak

Zhao Zhili quinkblack at foxmail.com
Sun Sep 30 07:01:27 CEST 2018


---
 src/input/vlm.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/input/vlm.c b/src/input/vlm.c
index 2182cb8..ba49d63 100644
--- a/src/input/vlm.c
+++ b/src/input/vlm.c
@@ -686,7 +686,13 @@ static int vlm_OnMediaUpdate( vlm_t *p_vlm, vlm_media_sys_t *p_media )
             }
             p_media->vod.p_media = p_vlm->p_vod->pf_media_new( p_vlm->p_vod,
                                                     p_cfg->psz_name, &item );
-
+            item.i_es = 0;
+            item.es = NULL;
+            for( int i = 0; i < data.i_es; i++ )
+            {
+                es_format_Clean( data.es[i] );
+                free( data.es[i] );
+            }
             TAB_CLEAN(data.i_es, data.es);
         }
     }
-- 
2.9.5





More information about the vlc-devel mailing list