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)
{
for (unsigned i = 0; i < VLC_H2_MAX_HEADERS; i++)
{
free(headers[i][1]);
free(headers[i][0]);
free(headers[i][1]);
}
val = -1;
}
......@@ -543,10 +543,17 @@ static int vlc_h2_parse_headers_end(struct vlc_h2_parser *p)
val = 0;
}
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
* for non-last header/continuation frames, but this does not make much
* sense. */
val = vlc_h2_stream_error(p, p->headers.sid, VLC_H2_REFUSED_STREAM);
}
if (p->headers.eos && s != NULL)
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