[vlc-devel] commit: Check malloc return value. (Jean-Paul Saman )

git version control git at videolan.org
Tue Dec 9 20:48:39 CET 2008


vlc | branch: 0.8.6-bugfix | Jean-Paul Saman <jpsaman at videolan.org> | Mon Dec  8 17:26:28 2008 +0100| [863e4bdd74ec6d9fc7c5eeb52481407b68a70933] | committer: Jean-Paul Saman 

Check malloc return value.

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

 src/input/mem_stream.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/input/mem_stream.c b/src/input/mem_stream.c
index 07dcc4b..03166a3 100644
--- a/src/input/mem_stream.c
+++ b/src/input/mem_stream.c
@@ -2,7 +2,7 @@
  * mem_stream.c: stream_t wrapper around memory buffer
  *****************************************************************************
  * Copyright (C) 1999-2004 the VideoLAN team
- * $Id$
+ * $Id: 07dcc4beaf8ea7e381275f279781e29d521e5ed6 $
  *
  * Authors: Sigmund Augdal Helberg <dnumgis at videolan.org>
  *
@@ -59,6 +59,8 @@ stream_t *__stream_MemoryNew( vlc_object_t *p_this, uint8_t *p_buffer,
     if( !s ) return NULL;
 
     s->p_sys = p_sys = malloc( sizeof( stream_sys_t ) );
+    if( !p_sys )
+        return NULL;
     p_sys->i_pos = 0;
     p_sys->i_size = i_size;
     p_sys->p_buffer = p_buffer;




More information about the vlc-devel mailing list