[MPlayer-cvslog] r32647 - trunk/stream/network.c

cboesch subversion at mplayerhq.hu
Thu Nov 25 11:04:07 CET 2010


Author: cboesch
Date: Thu Nov 25 11:04:07 2010
New Revision: 32647

Log:
Use calloc instead of malloc+memset.

Modified:
   trunk/stream/network.c

Modified: trunk/stream/network.c
==============================================================================
--- trunk/stream/network.c	Thu Nov 25 11:02:51 2010	(r32646)
+++ trunk/stream/network.c	Thu Nov 25 11:04:07 2010	(r32647)
@@ -111,13 +111,11 @@ const mime_struct_t mime_type_table[] = 
 
 streaming_ctrl_t *
 streaming_ctrl_new(void) {
-	streaming_ctrl_t *streaming_ctrl;
-	streaming_ctrl = malloc(sizeof(streaming_ctrl_t));
+	streaming_ctrl_t *streaming_ctrl = calloc(1, sizeof(*streaming_ctrl));
 	if( streaming_ctrl==NULL ) {
 		mp_msg(MSGT_NETWORK,MSGL_FATAL,MSGTR_MemAllocFailed);
 		return NULL;
 	}
-	memset( streaming_ctrl, 0, sizeof(streaming_ctrl_t) );
 	return streaming_ctrl;
 }
 


More information about the MPlayer-cvslog mailing list