cleanup: Replace two malloc+memset with calloc.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32723 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
cboesch 2010-12-19 14:19:04 +00:00 committed by Uoti Urpala
parent 7c8cb100af
commit b11e69b22a
2 changed files with 2 additions and 6 deletions

View File

@ -300,9 +300,8 @@ HTTP_header_t *
http_new_header(void) {
HTTP_header_t *http_hdr;
http_hdr = malloc(sizeof(HTTP_header_t));
http_hdr = calloc(1, sizeof(*http_hdr));
if( http_hdr==NULL ) return NULL;
memset( http_hdr, 0, sizeof(HTTP_header_t) );
return http_hdr;
}

View File

@ -101,15 +101,12 @@ url_new(const char* url) {
}
// Create the URL container
Curl = malloc(sizeof(URL_t));
Curl = calloc(1, sizeof(*Curl));
if( Curl==NULL ) {
mp_tmsg(MSGT_NETWORK,MSGL_FATAL,"Memory allocation failed.\n");
goto err_out;
}
// Initialisation of the URL container members
memset( Curl, 0, sizeof(URL_t) );
url_escape_string(escfilename,url);
// Copy the url in the URL container