Skip to content
Permalink
Browse files
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.
  • Loading branch information
astitcher committed Jun 22, 2022
1 parent 0dc72eb commit 9e461090c79fc4209f8977e2a850dc3a89fb2a01
Showing 1 changed file with 3 additions and 1 deletion.
@@ -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

0 comments on commit 9e46109

Please sign in to comment.