[vlc-devel] commit: Malloc return value. ( Rémi Duraffort )

git version control git at videolan.org
Mon Jun 23 22:05:43 CEST 2008


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Mon Jun 23 21:39:19 2008 +0200| [f3dad63031402c5f6ac2de72145420b8042728fa]

Malloc return value.

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

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

diff --git a/modules/stream_out/es.c b/modules/stream_out/es.c
index 059bd51..9002d3a 100644
--- a/modules/stream_out/es.c
+++ b/modules/stream_out/es.c
@@ -229,6 +229,8 @@ static char * es_print_url( char *psz_fmt, vlc_fourcc_t i_fourcc, int i_count,
     }
 
     p = psz_dst = malloc( 4096 );
+    if( !psz_dst )
+        return NULL;
     memset( p, 0, 4096 );
     for( ;; )
     {
@@ -391,6 +393,12 @@ static sout_stream_id_t *Add( sout_stream_t *p_stream, es_format_t *p_fmt )
     }
 
     id = malloc( sizeof( sout_stream_id_t ) );
+    if( !id )
+    {
+        sout_MuxDelete( p_mux );
+        sout_AccessOutDelete( p_access );
+        return NULL;
+    }
     id->p_mux = p_mux;
     id->p_input = sout_MuxAddStream( p_mux, p_fmt );
 




More information about the vlc-devel mailing list