summaryrefslogtreecommitdiffstats
path: root/libmpdemux
diff options
context:
space:
mode:
authorbertrand <bertrand@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-06-20 07:58:52 +0000
committerbertrand <bertrand@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-06-20 07:58:52 +0000
commit91cdc3a59607c594866863fcd2445b2c6cd9b4d6 (patch)
treef410cd57552c0eecb2f407fa5d9d0f1bcb59f3b9 /libmpdemux
parent41a890438e5cd078a0c0419c7746195fb1628379 (diff)
downloadmpv-91cdc3a59607c594866863fcd2445b2c6cd9b4d6.tar.bz2
mpv-91cdc3a59607c594866863fcd2445b2c6cd9b4d6.tar.xz
Removed unecessary malloc and memcpy.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@6466 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux')
-rw-r--r--libmpdemux/http.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/libmpdemux/http.c b/libmpdemux/http.c
index f22780d055..95db3bb029 100644
--- a/libmpdemux/http.c
+++ b/libmpdemux/http.c
@@ -30,7 +30,6 @@ http_free( HTTP_header_t *http_hdr ) {
if( http_hdr->protocol!=NULL ) free( http_hdr->protocol );
if( http_hdr->uri!=NULL ) free( http_hdr->uri );
if( http_hdr->reason_phrase!=NULL ) free( http_hdr->reason_phrase );
- if( http_hdr->body!=NULL ) free( http_hdr->body );
if( http_hdr->field_search!=NULL ) free( http_hdr->field_search );
if( http_hdr->method!=NULL ) free( http_hdr->method );
if( http_hdr->buffer!=NULL ) free( http_hdr->buffer );
@@ -164,14 +163,8 @@ http_response_parse( HTTP_header_t *http_hdr ) {
if( pos_hdr_sep+4<http_hdr->buffer_size ) {
// Response has data!
- int data_length = http_hdr->buffer_size-(pos_hdr_sep+4);
- http_hdr->body = (char*)malloc( data_length );
- if( http_hdr->body==NULL ) {
- mp_msg(MSGT_NETWORK,MSGL_ERR,"Memory allocation failed\n");
- return -1;
- }
- memcpy( http_hdr->body, http_hdr->buffer+pos_hdr_sep+4, data_length );
- http_hdr->body_size = data_length;
+ http_hdr->body = http_hdr->buffer+pos_hdr_sep+4;
+ http_hdr->body_size = http_hdr->buffer_size-(pos_hdr_sep+4);
}
http_hdr->is_parsed = 1;