Tarantool development patches archive
 help / color / mirror / Atom feed
* [PATCH] http: fix memory leak
@ 2018-12-20 15:47 Alexander Turenko
  2018-12-20 16:01 ` Vladimir Davydov
  0 siblings, 1 reply; 2+ messages in thread
From: Alexander Turenko @ 2018-12-20 15:47 UTC (permalink / raw)
  To: Vladimir Davydov; +Cc: Alexander Turenko, tarantool-patches

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] http: fix memory leak
  2018-12-20 15:47 [PATCH] http: fix memory leak Alexander Turenko
@ 2018-12-20 16:01 ` Vladimir Davydov
  0 siblings, 0 replies; 2+ messages in thread
From: Vladimir Davydov @ 2018-12-20 16:01 UTC (permalink / raw)
  To: Alexander Turenko; +Cc: tarantool-patches

Pushed to 2.1, 1.10, and 1.9.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-12-20 16:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-20 15:47 [PATCH] http: fix memory leak Alexander Turenko
2018-12-20 16:01 ` Vladimir Davydov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox