]> git.sesse.net Git - vlc/blobdiff - src/misc/stats.c
Use calloc when needed.
[vlc] / src / misc / stats.c
index d6302bd887cc9ca058b0c813834e940486e51a7a..b2e03efda29c9d93bd547d0b4c9cbbd4c6a15ce6 100644 (file)
@@ -143,12 +143,10 @@ int __stats_Get( vlc_object_t *p_this, counter_t *p_counter, vlc_value_t *val )
 input_stats_t *stats_NewInputStats( input_thread_t *p_input )
 {
     (void)p_input;
-    input_stats_t *p_stats = malloc( sizeof(input_stats_t) );
-
+    input_stats_t *p_stats = calloc( 1, sizeof(input_stats_t) );
     if( !p_stats )
         return NULL;
 
-    memset( p_stats, 0, sizeof(*p_stats) );
     vlc_mutex_init( &p_stats->lock );
     stats_ReinitInputStats( p_stats );