Commit ff9ec7d2 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

https: fix memory leak

parent ee50c987
...@@ -528,8 +528,8 @@ static int vlc_h2_parse_headers_end(struct vlc_h2_parser *p) ...@@ -528,8 +528,8 @@ static int vlc_h2_parse_headers_end(struct vlc_h2_parser *p)
{ {
for (unsigned i = 0; i < VLC_H2_MAX_HEADERS; i++) for (unsigned i = 0; i < VLC_H2_MAX_HEADERS; i++)
{ {
free(headers[i][1]);
free(headers[i][0]); free(headers[i][0]);
free(headers[i][1]);
} }
val = -1; val = -1;
} }
...@@ -543,10 +543,17 @@ static int vlc_h2_parse_headers_end(struct vlc_h2_parser *p) ...@@ -543,10 +543,17 @@ static int vlc_h2_parse_headers_end(struct vlc_h2_parser *p)
val = 0; val = 0;
} }
else else
{
for (int i = 0; i < val; i++)
{
free(headers[i][0]);
free(headers[i][1]);
}
/* NOTE: The specification implies that the error should also be sent /* NOTE: The specification implies that the error should also be sent
* for non-last header/continuation frames, but this does not make much * for non-last header/continuation frames, but this does not make much
* sense. */ * sense. */
val = vlc_h2_stream_error(p, p->headers.sid, VLC_H2_REFUSED_STREAM); val = vlc_h2_stream_error(p, p->headers.sid, VLC_H2_REFUSED_STREAM);
}
if (p->headers.eos && s != NULL) if (p->headers.eos && s != NULL)
p->cbs->stream_end(s); p->cbs->stream_end(s);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment