[PATCH] http: fix memory leak

Alexander Turenko alexander.turenko at tarantool.org
Thu Dec 20 18:47:34 MSK 2018


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




More information about the Tarantool-patches mailing list