]> git.sesse.net Git - vlc/commitdiff
Check malloc return value
authorJean-Paul Saman <jpsaman@videolan.org>
Mon, 11 Feb 2008 15:48:25 +0000 (15:48 +0000)
committerJean-Paul Saman <jpsaman@videolan.org>
Mon, 11 Feb 2008 15:48:25 +0000 (15:48 +0000)
modules/stream_out/standard.c
src/stream_output/stream_output.c

index edc04f509f841cd57be882774fe3a6b4d9eb89b6..476b8f063aa6eb9262c50bce73768a9cbac99f50 100644 (file)
@@ -31,7 +31,6 @@
 #include <vlc/vlc.h>
 #include <vlc_sout.h>
 
-
 #include <vlc_network.h>
 #include "vlc_url.h"
 
@@ -172,12 +171,12 @@ static int Open( vlc_object_t *p_this )
     psz_mux = *val.psz_string ? val.psz_string : NULL;
     if( !*val.psz_string ) free( val.psz_string );
 
-
     var_Get( p_stream, SOUT_CFG_PREFIX "dst", &val );
     psz_url = *val.psz_string ? val.psz_string : NULL;
     if( !*val.psz_string ) free( val.psz_string );
 
     p_sys = p_stream->p_sys = malloc( sizeof( sout_stream_sys_t) );
+    if( !p_sys ) return VLC_ENOMEM;
     p_stream->p_sys->p_session = NULL;
 
     msg_Dbg( p_this, "creating `%s/%s://%s'", psz_access, psz_mux, psz_url );
index 61e911f06394f7f36683954ec4e7e5f53a452021..a59b02ffbdbff9745ffcc38f7bc2610680c2bc5b 100644 (file)
@@ -526,6 +526,11 @@ sout_input_t *sout_MuxAddStream( sout_mux_t *p_mux, es_format_t *p_fmt )
 
     /* create a new sout input */
     p_input = malloc( sizeof( sout_input_t ) );
+    if( !p_input )
+    {
+        msg_Err( p_mux, "out of memory" );
+        return NULL;
+    }
     p_input->p_sout = p_mux->p_sout;
     p_input->p_fmt  = p_fmt;
     p_input->p_fifo = block_FifoNew( p_mux->p_sout );