vlc | branch: master | Rémi Denis-Courmont <[email protected]> | Mon Dec 14 23:34:48 2015 +0200| [ff9ec7d2bad783e4a556943cadeaef2b7d056028] | committer: Rémi Denis-Courmont
https: fix memory leak > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ff9ec7d2bad783e4a556943cadeaef2b7d056028 --- modules/access/http/h2frame.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/access/http/h2frame.c b/modules/access/http/h2frame.c index 6e71420..5a9504b 100644 --- a/modules/access/http/h2frame.c +++ b/modules/access/http/h2frame.c @@ -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); _______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
