This is an automated email from the ASF dual-hosted git repository.

gsim pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git

commit 66ab58c6b425ce921871792ddc47f021ef59342f
Author: Chuck Rolke <c...@apache.org>
AuthorDate: Thu May 20 13:29:45 2021 -0400

    DISPATCH-2142: TCP adaptor must free malloc'd bytes at shutdown
---
 src/adaptors/tcp_adaptor.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/adaptors/tcp_adaptor.c b/src/adaptors/tcp_adaptor.c
index b003732..940d65f 100644
--- a/src/adaptors/tcp_adaptor.c
+++ b/src/adaptors/tcp_adaptor.c
@@ -430,6 +430,8 @@ static void free_qdr_tcp_connection(qdr_tcp_connection_t* 
tc)
         qd_timer_free(tc->activate_timer);
     }
     sys_mutex_free(tc->activation_lock);
+    free(tc->write_buffer.bytes);
+    free(tc->read_buffer.bytes);
     //proactor will free the socket
     free_qdr_tcp_connection_t(tc);
 }
@@ -477,7 +479,9 @@ static void handle_disconnected(qdr_tcp_connection_t* conn)
         conn->qdr_conn = 0;
     }
     free(conn->write_buffer.bytes);
+    conn->write_buffer.bytes = 0;
     free(conn->read_buffer.bytes);
+    conn->read_buffer.bytes = 0;
 
     //need to free on core thread to avoid deleting while in use by management 
agent
     qdr_action_t *action = qdr_action(qdr_del_tcp_connection_CT, 
"delete_tcp_connection");

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org
For additional commands, e-mail: commits-h...@qpid.apache.org

Reply via email to