From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Alexander Turenko Subject: [PATCH] http: fix memory leak Date: Thu, 20 Dec 2018 18:47:34 +0300 Message-Id: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: Vladimir Davydov Cc: Alexander Turenko , tarantool-patches@freelists.org List-ID: The calloc() in parse_headers() leads to lost of 32 bytes on each http_client request. The problem was introduced in 1.9.1-38-g3d121dd4a. Found with ASAN. --- no issue https://github.com/tarantool/tarantool/tree/Totktonada/fix-http-client-memleak Please, push it to 2.1, 1.10 and 1.9. src/lua/httpc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lua/httpc.c b/src/lua/httpc.c index 5f4e2e912..5572b70e9 100644 --- a/src/lua/httpc.c +++ b/src/lua/httpc.c @@ -112,6 +112,8 @@ parse_headers(lua_State *L, char *buffer, size_t len, } } + free(parser.hdr_name); + /* headers */ lua_settable(L, -3); -- 2.20.0