THRIFT-5122: Fix memory leak on accept error in thrift_simple_server_serve()
Client: c_glib
Patch: wangyunjian
This closes #2039
Signed-off-by: wangyunjian <wangyunjian@huawei.com>
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 53e2508..0c89459 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
@@ -83,7 +83,10 @@
g_object_unref (input_protocol);
g_object_unref (output_protocol);
}
-
+ if ((*error) != NULL) {
+ g_message ("thrift_simple_server_serve : %s", (*error)->message);
+ g_clear_error (error);
+ }
if (t != NULL)
{
g_object_unref (t);