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

git version control git at videolan.org
Fri Apr 11 13:21:45 CEST 2008


vlc | branch: master | Jean-Paul Saman <jean-paul.saman at m2x.nl> | Fri Apr 11 10:43:04 2008 +0200| [c72f2f9dcdcdb330488f01317758086f612b3044]

Check malloc return value

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

 src/misc/stats.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/misc/stats.c b/src/misc/stats.c
index a922fe8..e8f4bdd 100644
--- a/src/misc/stats.c
+++ b/src/misc/stats.c
@@ -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;




More information about the vlc-devel mailing list