diff --git a/libmpdemux/http.c b/libmpdemux/http.c index 8caad2ba84..2368592f1f 100644 --- a/libmpdemux/http.c +++ b/libmpdemux/http.c @@ -175,7 +175,7 @@ http_build_request( HTTP_header_t *http_hdr ) { if( http_hdr->method==NULL ) http_set_method( http_hdr, "GET"); if( http_hdr->uri==NULL ) http_set_uri( http_hdr, "/"); else { - uri = (char*)malloc(strlen(http_hdr->uri)*2); + uri = (char*)malloc((strlen(http_hdr->uri)*3) + 1); if( uri==NULL ) { mp_msg(MSGT_NETWORK,MSGL_ERR,"Memory allocation failed\n"); return NULL;