summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
authorcboesch <cboesch@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-12-19 14:19:04 +0000
committerUoti Urpala <uau@glyph.nonexistent.invalid>2011-01-29 02:50:00 +0200
commitb11e69b22a23116f795e5dbb8b5d63bbef1047c5 (patch)
tree6cdf79814c20c54efc4a249e7341e26cc0603218 /stream
parent7c8cb100afd0186766f8c7f0f4ce069845ba845a (diff)
downloadmpv-b11e69b22a23116f795e5dbb8b5d63bbef1047c5.tar.bz2
mpv-b11e69b22a23116f795e5dbb8b5d63bbef1047c5.tar.xz
cleanup: Replace two malloc+memset with calloc.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32723 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'stream')
-rw-r--r--stream/http.c3
-rw-r--r--stream/url.c5
2 files changed, 2 insertions, 6 deletions
diff --git a/stream/http.c b/stream/http.c
index 1e7b8dab76..65abe90677 100644
--- a/stream/http.c
+++ b/stream/http.c
@@ -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;
}
diff --git a/stream/url.c b/stream/url.c
index c898d092b5..c505ab99d8 100644
--- a/stream/url.c
+++ b/stream/url.c
@@ -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