summaryrefslogtreecommitdiff
path: root/lib/c_glib
diff options
context:
space:
mode:
authorwangyunjian <wangyunjian@huawei.com>2020-02-18 09:11:53 -0500
committerJens Geyer <jensg@apache.org>2020-02-21 21:35:39 +0100
commitea4a086757f834880220c50392532b60751c6885 (patch)
treed93055380b3b0cc1e1338cafb2df5f72e4645685 /lib/c_glib
parentbd26d385693e4f172c348dc27f9d1e23288c50cf (diff)
downloadthrift-ea4a086757f834880220c50392532b60751c6885.tar.gz
THRIFT-5102: Fix memory leak in thrift_simple_server_serve()
Client: c_glib Patch: wangyunjian This closes #2012 Signed-off-by: wangyunjian <wangyunjian@huawei.com>
Diffstat (limited to 'lib/c_glib')
-rw-r--r--lib/c_glib/src/thrift/c_glib/server/thrift_simple_server.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/c_glib/src/thrift/c_glib/server/thrift_simple_server.c b/lib/c_glib/src/thrift/c_glib/server/thrift_simple_server.c
index 22a96c7a4..53e2508f7 100644
--- a/lib/c_glib/src/thrift/c_glib/server/thrift_simple_server.c
+++ b/lib/c_glib/src/thrift/c_glib/server/thrift_simple_server.c
@@ -78,6 +78,15 @@ thrift_simple_server_serve (ThriftServer *server, GError **error)
NULL);
THRIFT_TRANSPORT_GET_CLASS (output_transport)->close (output_transport,
NULL);
+ g_object_unref (input_transport);
+ g_object_unref (output_transport);
+ g_object_unref (input_protocol);
+ g_object_unref (output_protocol);
+ }
+
+ if (t != NULL)
+ {
+ g_object_unref (t);
}
}