[vlc-commits] srt: use vlc_obj_strdup()

Rémi Denis-Courmont git at videolan.org
Mon Jul 2 20:52:20 CEST 2018


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Jul  1 21:39:19 2018 +0300| [4f77416d958e53b507bba7450023ff84e1e8459f] | committer: Rémi Denis-Courmont

srt: use vlc_obj_strdup()

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

 modules/access/srt.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/modules/access/srt.c b/modules/access/srt.c
index 9b28f5ddb6..d0dadfbba3 100644
--- a/modules/access/srt.c
+++ b/modules/access/srt.c
@@ -318,7 +318,7 @@ static int Open(vlc_object_t *p_this)
         goto failed;
     }
 
-    p_sys->psz_host = strdup( parsed_url.psz_host );
+    p_sys->psz_host = vlc_obj_strdup( p_this, parsed_url.psz_host );
     p_sys->i_port = parsed_url.i_port;
 
     vlc_UrlClean( &parsed_url );
@@ -348,8 +348,6 @@ failed:
     if ( p_sys->sock != -1 ) srt_close( p_sys->sock );
     if ( p_sys->i_poll_id != -1 ) srt_epoll_release( p_sys->i_poll_id );
 
-    free( p_sys->psz_host );
-
     return VLC_EGENERIC;
 }
 
@@ -364,7 +362,6 @@ static void Close(vlc_object_t *p_this)
     srt_close( p_sys->sock );
     srt_epoll_release( p_sys->i_poll_id );
 
-    free( p_sys->psz_host );
     srt_cleanup();
 }
 



More information about the vlc-commits mailing list