[vlc-commits] [Git][videolan/vlc][master] stream_out: record: fix psz_file string and probe file leak

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Thu Oct 15 18:40:31 UTC 2026



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
eb142584 by Alexandre Janniaux at 2026-10-15T20:21:31+02:00
stream_out: record: fix psz_file string and probe file leak

The psz_file is local to the loop and must be released before break or
before the next iteration. Since it's only used during OutputNew, we can
release the memory once OutputNew is finished, but we need to clean up
the file later when the whole pipeline writing to it is closed.

- - - - -


1 changed file:

- modules/stream_out/record.c


Changes:

=====================================
modules/stream_out/record.c
=====================================
@@ -513,6 +513,9 @@ static void OutputStart( sout_stream_t *p_stream )
                 sout_StreamChainDelete( p_sys->p_out, NULL );
             p_sys->p_out = NULL;
 
+            vlc_unlink( psz_file );
+            free( psz_file );
+
             if( i_es > i_best_es )
             {
                 i_best_es = i_es;
@@ -521,8 +524,6 @@ static void OutputStart( sout_stream_t *p_stream )
                 if( i_best_es >= p_sys->i_id )
                     break;
             }
-            vlc_unlink( psz_file );
-            free( psz_file );
         }
 
         /* */



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

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/eb1425848017f2042b466a5abda9688a049416e4
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help




More information about the vlc-commits mailing list