From 29a0121134eebffba0ef89366b4f55458b577f5e Mon Sep 17 00:00:00 2001 From: luwenpeng Date: Mon, 5 Aug 2019 10:50:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20http2=5Fplugin=5Ftimer=5Fg?= =?UTF-8?q?c=5Fcb()=20=E5=86=85=E5=AD=98=E6=B3=84=E9=9C=B2=E7=9A=84=20bug,?= =?UTF-8?q?=20gc=5Fcb()=20=E7=9B=AE=E5=89=8D=E8=99=BD=E6=9C=AA=E8=A2=AB?= =?UTF-8?q?=E8=B0=83=E7=94=A8=EF=BC=8C=E4=B8=80=E6=97=A6=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E5=88=99=E4=BC=9A=E4=BA=A7=E7=94=9F=E5=86=85=E5=AD=98=E6=B3=84?= =?UTF-8?q?=E9=9C=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin/protocol/http2/src/http2_plugin.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugin/protocol/http2/src/http2_plugin.cpp b/plugin/protocol/http2/src/http2_plugin.cpp index 9dc41ce..24caa62 100644 --- a/plugin/protocol/http2/src/http2_plugin.cpp +++ b/plugin/protocol/http2/src/http2_plugin.cpp @@ -63,6 +63,12 @@ UNUSED static void http2_plugin_timer_gc_cb(evutil_socket_t fd, short what, void { struct tfe_h2_stream *h2_stream_info = (struct tfe_h2_stream *)arg; sess_data_ctx_fini(h2_stream_info, NULL, h2_stream_info->thread_id); + + // Although this function is not called now, + // there is a potential bug in memory leaks where it is called. + // A better practice is to free the memory in the sess_data_ctx_fini() function. + free(h2_stream_info); + h2_stream_info = NULL; } static int