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

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


The following commit(s) were added to refs/heads/main by this push:
     new 9e461090c PROTON-2568: Free raw connection addrinfo in raw connection 
cleanup
9e461090c is described below

commit 9e461090c79fc4209f8977e2a850dc3a89fb2a01
Author: Andrew Stitcher <astitc...@apache.org>
AuthorDate: Wed Jun 22 11:59:59 2022 +0100

    PROTON-2568: Free raw connection addrinfo in raw connection cleanup
    
    This covers the case that the raw connection is cleaned up between
    starting the connection and processing the event for actually
    connecting the connection.
---
 c/src/proactor/epoll_raw_connection.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/c/src/proactor/epoll_raw_connection.c 
b/c/src/proactor/epoll_raw_connection.c
index 4d459a28c..919a4b808 100644
--- a/c/src/proactor/epoll_raw_connection.c
+++ b/c/src/proactor/epoll_raw_connection.c
@@ -73,7 +73,7 @@ static void praw_connection_connected_lh(praw_connection_t 
*prc) {
   prc->connected = true;
   if (prc->addrinfo) {
     freeaddrinfo(prc->addrinfo);
-        prc->addrinfo = NULL;
+    prc->addrinfo = NULL;
   }
   prc->ai = NULL;
   socklen_t len = sizeof(prc->remote.ss);
@@ -159,6 +159,8 @@ static void praw_connection_cleanup(praw_connection_t *prc) 
{
   unlock(&prc->task.mutex);
   if (can_free) {
     task_finalize(&prc->task);
+    if (prc->addrinfo)
+      freeaddrinfo(prc->addrinfo);
     free(prc);
   }
   // else proactor_disconnect logic owns prc and its final free


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

Reply via email to