summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwangyunjian <wangyunjian@huawei.com>2020-03-08 17:31:21 +0800
committerJens Geyer <jensg@apache.org>2020-09-02 08:54:35 +0200
commit935770c6b077fd96430684049078bdb9bdff50c5 (patch)
tree124d39ef5293e40c68e8cf90c89b27fb3117281c
parent073166f2c4b99b5ab4b425dd2dfc137b00a2e260 (diff)
downloadthrift-935770c6b077fd96430684049078bdb9bdff50c5.tar.gz
THRIFT-5136: Fix memory leak in thrift_multiplexed_processor_process_impl()
Client: c_glib Patch: wangyunjian <wangyunjian@huawei.com> This closes #2052 Signed-off-by: wangyunjian <wangyunjian@huawei.com>
-rw-r--r--lib/c_glib/src/thrift/c_glib/processor/thrift_multiplexed_processor.c8
-rw-r--r--lib/c_glib/src/thrift/c_glib/protocol/thrift_stored_message_protocol.c2
2 files changed, 3 insertions, 7 deletions
diff --git a/lib/c_glib/src/thrift/c_glib/processor/thrift_multiplexed_processor.c b/lib/c_glib/src/thrift/c_glib/processor/thrift_multiplexed_processor.c
index 12a24a7f2..7a5600ce5 100644
--- a/lib/c_glib/src/thrift/c_glib/processor/thrift_multiplexed_processor.c
+++ b/lib/c_glib/src/thrift/c_glib/processor/thrift_multiplexed_processor.c
@@ -215,13 +215,9 @@ thrift_multiplexed_processor_process_impl (ThriftProcessor *processor, ThriftPro
}
- /*
- FIXME This makes everything fail, I don't know why.
- if(stored_message_protocol!=NULL){
- // After its use we must free it
- g_object_unref(stored_message_protocol);
+ if (stored_message_protocol != NULL) {
+ g_object_unref (stored_message_protocol);
}
- */
return retval;
}
diff --git a/lib/c_glib/src/thrift/c_glib/protocol/thrift_stored_message_protocol.c b/lib/c_glib/src/thrift/c_glib/protocol/thrift_stored_message_protocol.c
index 22aca8a29..6f1586f23 100644
--- a/lib/c_glib/src/thrift/c_glib/protocol/thrift_stored_message_protocol.c
+++ b/lib/c_glib/src/thrift/c_glib/protocol/thrift_stored_message_protocol.c
@@ -55,7 +55,7 @@ thrift_stored_message_protocol_read_message_begin (ThriftProtocol *protocol,
ThriftStoredMessageProtocol *self = THRIFT_STORED_MESSAGE_PROTOCOL (protocol);
/* We return the stored values on construction */
- *name = self->name;
+ *name = g_strdup (self->name);
*message_type = self->mtype;
*seqid = self->seqid;