From 585cd4585acb8c3d0a9ad23a2baaff90310c6ec9 Mon Sep 17 00:00:00 2001
From: Maria Khaydich <maria.khaydich@tarantool.org>
Date: Tue, 27 Aug 2019 19:37:56 +0300
Subject: [PATCH] Iproto call won't leak if transaction isn't committed

In case of throwing client error because of inactive function
we did not destroy used port. It could possibly cause huge
memory leaks as could be seen with top or its analogues when
performing net.box test run in a loop.

Closes #4388

(cherry picked from commit 7691154af1a51a620db2d3cc80bf8b8d8ca18714)
---
 src/box/call.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/box/call.c b/src/box/call.c
index ac2bf30049..1692107673 100644
--- a/src/box/call.c
+++ b/src/box/call.c
@@ -132,6 +132,7 @@ box_process_call(struct call_request *request, struct port *port)
 
 	if (txn != NULL) {
 		diag_set(ClientError, ER_FUNCTION_TX_ACTIVE);
+		port_destroy(port);
 		txn_rollback(txn);
 		fiber_gc();
 		return -1;
-- 
GitLab