Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Steve Lhomme
VLC
Commits
90fdcf71
Commit
90fdcf71
authored
Mar 10, 2004
by
Laurent Aimar
Browse files
* httpd: fixed a big mem leak for http streaming.
parent
144bd771
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/misc/httpd.c
View file @
90fdcf71
...
...
@@ -1293,6 +1293,7 @@ static void httpd_ClientClean( httpd_client_t *cl )
if
(
cl
->
fd
>
0
)
{
SOCKET_CLOSE
(
cl
->
fd
);
cl
->
fd
=
-
1
;
}
httpd_MsgClean
(
&
cl
->
answer
);
...
...
@@ -1301,6 +1302,7 @@ static void httpd_ClientClean( httpd_client_t *cl )
if
(
cl
->
p_buffer
)
{
free
(
cl
->
p_buffer
);
cl
->
p_buffer
=
NULL
;
}
}
...
...
@@ -1708,7 +1710,12 @@ static void httpd_ClientSend( httpd_client_t *cl )
!
cl
->
b_read_waiting
)
{
/* catch more body data */
int
i_msg
=
cl
->
query
.
i_type
;
int
i_msg
=
cl
->
query
.
i_type
;
int64_t
i_offset
=
cl
->
answer
.
i_body_offset
;
httpd_MsgClean
(
&
cl
->
answer
);
cl
->
answer
.
i_body_offset
=
i_offset
;
cl
->
url
->
catch
[
i_msg
].
cb
(
cl
->
url
->
catch
[
i_msg
].
p_sys
,
cl
,
&
cl
->
answer
,
&
cl
->
query
);
}
...
...
@@ -2054,6 +2061,11 @@ static void httpd_HostThread( httpd_host_t *host )
httpd_MsgClean
(
&
cl
->
answer
);
cl
->
answer
.
i_body_offset
=
i_offset
;
free
(
cl
->
p_buffer
);
cl
->
p_buffer
=
NULL
;
cl
->
i_buffer
=
0
;
cl
->
i_buffer_size
=
0
;
cl
->
i_state
=
HTTPD_CLIENT_WAITING
;
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment