Check malloc return value.
authorJean-Paul Saman <jpsaman@videolan.org>
Fri, 26 Oct 2007 15:07:48 +0000 (15:07 +0000)
committerJean-Paul Saman <jpsaman@videolan.org>
Fri, 26 Oct 2007 15:07:48 +0000 (15:07 +0000)
src/misc/block.c

index 12fa046..ed4abc4 100644 (file)
@@ -172,6 +172,7 @@ block_fifo_t *__block_FifoNew( vlc_object_t *p_obj )
     block_fifo_t *p_fifo;
 
     p_fifo = malloc( sizeof( block_fifo_t ) );
+    if( !p_fifo ) return NULL;
     vlc_mutex_init( p_obj, &p_fifo->lock );
     vlc_cond_init( p_obj, &p_fifo->wait );
     p_fifo->p_first = NULL;