[vlc-commits] [Git][videolan/vlc][master] access: mmsh: fix error handling logic in OpenConnection

Steve Lhomme (@robUx4) gitlab at videolan.org
Thu Dec 18 04:11:33 UTC 2025



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
9fe75d22 by Abderhman Gamal at 2025-12-17T11:32:21+01:00
access: mmsh: fix error handling logic in OpenConnection

When vlc_tls_Write fails, the socket is closed, but the 'sock' pointer
was not set to NULL. Instead, 'stream' was set to NULL, which seems
to be a typo.

This caused two issues:
1. Coverity flagged the return statement as dead code because 'sock'
   was never NULL at that point.
2. The function returned VLC_SUCCESS even when the connection failed.

This patch fixes the typo by setting sock to NULL on error.

Fixes #29336

Signed-off-by: Abderhman Gamal <abderhmangamal246 at gmail.com>

- - - - -


1 changed file:

- modules/access/mms/mmsh.c


Changes:

=====================================
modules/access/mms/mmsh.c
=====================================
@@ -543,7 +543,7 @@ static int OpenConnection( stream_t *p_access,
     {
         msg_Err( p_access, "failed to send request" );
         vlc_tls_Close( sock );
-        stream = NULL;
+        sock = NULL;
     }
 
     p_sys->stream = sock;



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/9fe75d22321cb5b8c80c7fa3ff7db61e86bb131b

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/9fe75d22321cb5b8c80c7fa3ff7db61e86bb131b
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