[vlc-commits] dsm: fix memory leak

Thomas Guillem git at videolan.org
Wed Jun 27 13:25:25 CEST 2018


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Wed Jun 27 13:24:53 2018 +0200| [1e6a20cf569f9033a89b114e308055077cb947fe] | committer: Thomas Guillem

dsm: fix memory leak

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

 modules/access/dsm/access.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/modules/access/dsm/access.c b/modules/access/dsm/access.c
index 66232981b9..8bb7998294 100644
--- a/modules/access/dsm/access.c
+++ b/modules/access/dsm/access.c
@@ -524,8 +524,10 @@ static int add_item( stream_t *p_access, struct vlc_readdir_helper *p_rdh,
     if( i_ret == -1 )
         return VLC_ENOMEM;
 
-    return vlc_readdir_helper_additem( p_rdh, psz_uri, NULL, psz_name, i_type,
-                                       ITEM_NET );
+    i_ret = vlc_readdir_helper_additem( p_rdh, psz_uri, NULL, psz_name, i_type,
+                                        ITEM_NET );
+    free( psz_uri );
+    return i_ret;
 }
 
 static int BrowseShare( stream_t *p_access, input_item_node_t *p_node )



More information about the vlc-commits mailing list