[vlc-commits] [Git][videolan/vlc][master] 5 commits: srt: fix vlc_url_t leak on error

Steve Lhomme (@robUx4) gitlab at videolan.org
Thu Nov 6 09:37:40 UTC 2025



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
9833ca0f by Steve Lhomme at 2025-11-06T09:00:39+00:00
srt: fix vlc_url_t leak on error

We don't need to initialize the variable.

- - - - -
2523b577 by Steve Lhomme at 2025-11-06T09:00:39+00:00
demux: subtitle: fix leak on URL parsing error

A vlc_url_t always needs to be cleaned after a call to vlc_UrlParse().

- - - - -
44275c37 by Steve Lhomme at 2025-11-06T09:00:39+00:00
audioscrobbler: fix URL leak on errors

A vlc_url_t always needs to be cleaned after a call to vlc_UrlParse().

- - - - -
7fdac31e by Steve Lhomme at 2025-11-06T09:00:39+00:00
ftp: fix URL leak on error

A vlc_url_t always needs to be cleaned after a call to vlc_UrlParseFixup().

- - - - -
1afc99f7 by Steve Lhomme at 2025-11-06T09:00:39+00:00
samba: fix URL leak on error

A vlc_url_t always needs to be cleaned after a call to vlc_UrlParseFixup().

- - - - -


5 changed files:

- modules/access/ftp.c
- modules/access/samba.c
- modules/access/srt.c
- modules/demux/subtitle.c
- modules/misc/audioscrobbler.c


Changes:

=====================================
modules/access/ftp.c
=====================================
@@ -460,6 +460,7 @@ static int Login( vlc_object_t *p_access, access_sys_t *p_sys, const char *path
                             NULL, NULL ) == -EINTR )
     {
         vlc_credential_clean( &credential );
+        vlc_UrlClean( &url );
         goto error;
     }
 


=====================================
modules/access/samba.c
=====================================
@@ -319,7 +319,10 @@ static int Open(vlc_object_t *obj)
     if (vlc_credential_get(&sys->credential, access, "smb-user", "smb-pwd",
                            NULL, NULL)
         == -EINTR)
+    {
+        vlc_UrlClean(&url);
         goto error;
+    }
 
     smbc_stat_fn stat_fn = smbc_getFunctionStat(sys->ctx);
     assert(stat_fn);


=====================================
modules/access/srt.c
=====================================
@@ -352,7 +352,7 @@ static int Open(vlc_object_t *p_this)
 {
     stream_t     *p_stream = (stream_t*)p_this;
     stream_sys_t *p_sys = NULL;
-    vlc_url_t     parsed_url = { 0 };
+    vlc_url_t     parsed_url;
 
     p_sys = vlc_obj_calloc( p_this, 1, sizeof( *p_sys ) );
     if( unlikely( p_sys == NULL ) )
@@ -368,6 +368,7 @@ static int Open(vlc_object_t *p_this)
     {
         msg_Err( p_stream, "Failed to parse input URL (%s)",
             p_stream->psz_url );
+        vlc_UrlClean( &parsed_url );
         goto failed;
     }
 


=====================================
modules/demux/subtitle.c
=====================================
@@ -2508,7 +2508,10 @@ static char *get_language_from_url(const char *urlstr)
     assert(urlstr != NULL);
 
     if (vlc_UrlParse(&url, urlstr) != 0)
+    {
+        vlc_UrlClean(&url);
         return NULL;
+    }
     if (url.psz_path != NULL)
         filename = strrchr(url.psz_path, '/');
     if (filename != NULL) {


=====================================
modules/misc/audioscrobbler.c
=====================================
@@ -619,12 +619,18 @@ static int Handshake(intf_thread_t *p_this)
 
     p_buffer_pos = strstr(p_buffer_pos, "http://");
     if (!p_buffer_pos || strlen(p_buffer_pos) == 7)
+    {
+        vlc_UrlClean(&p_sys->p_nowp_url);
         goto proto;
+    }
 
     /* We need to read the submission url */
     psz_url = strndup(p_buffer_pos, strcspn(p_buffer_pos, "\n"));
     if (!psz_url)
+    {
+        vlc_UrlClean(&p_sys->p_nowp_url);
         goto oom;
+    }
 
     /* parse the submission url */
     vlc_UrlParse(&p_sys->p_submit_url, psz_url);



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/25978d34afaaff147f337180c74a72faeff4918b...1afc99f7ffb017f84b7d91d43aa61d93fc05384c

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/25978d34afaaff147f337180c74a72faeff4918b...1afc99f7ffb017f84b7d91d43aa61d93fc05384c
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list