]> git.sesse.net Git - vlc/commitdiff
Check malloc return value
authorJean-Paul Saman <jean-paul.saman@m2x.nl>
Fri, 11 Apr 2008 08:43:04 +0000 (10:43 +0200)
committerJean-Paul Saman <jean-paul.saman@m2x.nl>
Fri, 11 Apr 2008 08:43:04 +0000 (10:43 +0200)
src/misc/stats.c

index a922fe893c397dfbad2397a829e9b534485d5161..e8f4bdd2dd302f6c1891126048af0ad7c6160aa5 100644 (file)
@@ -62,6 +62,7 @@ counter_t * __stats_CounterCreate( vlc_object_t *p_this,
     counter_t *p_counter = (counter_t*) malloc( sizeof( counter_t ) ) ;
     (void)p_this;
 
+    if( !p_counter ) return NULL;
     p_counter->i_compute_type = i_compute_type;
     p_counter->i_type = i_type;
     p_counter->i_samples = 0;