changeset 32560:1dd48bfb04a2

Use calloc instead of malloc+memset.
author cboesch
date Thu, 25 Nov 2010 10:04:07 +0000
parents 8811ad374937
children 17bb5a38ae2e
files stream/network.c
diffstat 1 files changed, 1 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/stream/network.c	Thu Nov 25 10:02:51 2010 +0000
+++ b/stream/network.c	Thu Nov 25 10:04:07 2010 +0000
@@ -111,13 +111,11 @@
 
 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;
 }