[vlc-devel] commit: Avoid to leak to many things on es stream output ( and fix a compilation warning) ( Rémi Duraffort )

git version control git at videolan.org
Wed Aug 13 21:46:11 CEST 2008


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Wed Aug 13 21:46:06 2008 +0200| [7f0b979cf1e631a42a29f1b6259eef5d8c48876d] | committer: Rémi Duraffort 

Avoid to leak to many things on es stream output (and fix a compilation warning)

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

 modules/stream_out/es.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/modules/stream_out/es.c b/modules/stream_out/es.c
index 9002d3a..52bb86d 100644
--- a/modules/stream_out/es.c
+++ b/modules/stream_out/es.c
@@ -225,7 +225,7 @@ static char * es_print_url( char *psz_fmt, vlc_fourcc_t i_fourcc, int i_count,
 
     if( psz_fmt == NULL || !*psz_fmt )
     {
-        psz_fmt = "stream-%n-%c.%m";
+        psz_fmt = (char*)"stream-%n-%c.%m";
     }
 
     p = psz_dst = malloc( 4096 );
@@ -374,6 +374,7 @@ static sout_stream_id_t *Add( sout_stream_t *p_stream, es_format_t *p_fmt )
                     _("There is no suitable stream-output access module for \"%s/%s://%s\"."),
                           psz_access,
                           psz_mux, psz_dst );
+        free( psz_dst );
         return( NULL );
     }
 
@@ -389,8 +390,10 @@ static sout_stream_id_t *Add( sout_stream_t *p_stream, es_format_t *p_fmt )
                           "for \"%s/%s://%s\"."),
                           psz_access, psz_mux, psz_dst );
         sout_AccessOutDelete( p_access );
+        free( psz_dst );
         return( NULL );
     }
+    free( psz_dst );
 
     id = malloc( sizeof( sout_stream_id_t ) );
     if( !id )




More information about the vlc-devel mailing list