mirror of
https://github.com/mpv-player/mpv
synced 2025-01-27 01:53:32 +00:00
Merge malloc+memset -> calloc
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29929 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
450d40d443
commit
a81e043f98
@ -396,8 +396,7 @@ stream_t* new_memory_stream(unsigned char* data,int len){
|
||||
|
||||
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 char* data,int len){
|
||||
}
|
||||
|
||||
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
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user