[MPlayer-cvslog] r29929 - trunk/stream/stream.c
reimar
subversion at mplayerhq.hu
Tue Nov 17 20:14:42 CET 2009
Author: reimar
Date: Tue Nov 17 20:14:42 2009
New Revision: 29929
Log:
Merge malloc+memset -> calloc
Modified:
trunk/stream/stream.c
Modified: trunk/stream/stream.c
==============================================================================
--- trunk/stream/stream.c Tue Nov 17 19:30:33 2009 (r29928)
+++ trunk/stream/stream.c Tue Nov 17 20:14:42 2009 (r29929)
@@ -396,8 +396,7 @@ stream_t* new_memory_stream(unsigned cha
if(len < 0)
return NULL;
- s=malloc(sizeof(stream_t)+len);
- memset(s,0,sizeof(stream_t));
+ s=calloc(1, sizeof(stream_t)+len);
s->fd=-1;
s->type=STREAMTYPE_MEMORY;
s->buf_pos=0; s->buf_len=len;
@@ -409,9 +408,8 @@ stream_t* new_memory_stream(unsigned cha
}
stream_t* new_stream(int fd,int type){
- stream_t *s=malloc(sizeof(stream_t));
+ stream_t *s=calloc(1, sizeof(stream_t));
if(s==NULL) return NULL;
- memset(s,0,sizeof(stream_t));
#if HAVE_WINSOCK2_H
{
More information about the MPlayer-cvslog
mailing list