]> git.sesse.net Git - vlc/commitdiff
Use calloc instead of malloc+memset.
authorRémi Duraffort <ivoire@videolan.org>
Fri, 12 Dec 2008 19:22:18 +0000 (20:22 +0100)
committerRémi Duraffort <ivoire@videolan.org>
Fri, 12 Dec 2008 19:22:18 +0000 (20:22 +0100)
src/input/vlm.c

index 7e1721fdcfb6a33d42ca9e6a9328f9159dc61c13..e9d53adb3a77355f037b2aa23db447b1fe2405ef 100644 (file)
@@ -622,10 +622,9 @@ static int vlm_ControlMediaAdd( vlm_t *p_vlm, vlm_media_t *p_cfg, int64_t *p_id
         p_vlm->p_vod->pf_media_control = vlm_MediaVodControl;
     }
 
-    p_media = malloc( sizeof( vlm_media_sys_t ) );
+    p_media = calloc( 1, sizeof( vlm_media_sys_t ) );
     if( !p_media )
         return VLC_ENOMEM;
-    memset( p_media, 0, sizeof(vlm_media_sys_t) );
 
     if( p_cfg->b_vod )
         p_vlm->i_vod++;
@@ -743,12 +742,10 @@ static vlm_media_instance_sys_t *vlm_ControlMediaInstanceGetByName( vlm_media_sy
 }
 static vlm_media_instance_sys_t *vlm_MediaInstanceNew( vlm_t *p_vlm, const char *psz_name )
 {
-    vlm_media_instance_sys_t *p_instance = malloc( sizeof(vlm_media_instance_sys_t) );
+    vlm_media_instance_sys_t *p_instance = calloc( 1, sizeof(vlm_media_instance_sys_t) );
     if( !p_instance )
         return NULL;
 
-    memset( p_instance, 0, sizeof(vlm_media_instance_sys_t) );
-
     p_instance->psz_name = NULL;
     if( psz_name )
         p_instance->psz_name = strdup( psz_name );
@@ -1154,3 +1151,4 @@ int vlm_Control( vlm_t *p_vlm, int i_query, ... )
 
     return i_result;
 }
+