From 7e0eab0c891a2882371245d4fd6097f1b9bd399f Mon Sep 17 00:00:00 2001 From: Mohamed Shaikh Date: Wed, 24 May 2023 20:52:51 +0530 Subject: [PATCH 1/2] Title: Memory leak fix Reason for change : The order of unreferencing was wrong, leading to leak redirectURL struct member as the parent reference is freed first and then tried to free the child of freed parent pointer. This commit fixes the same Signed-off-by: Mohamed Shaikh --- src/nopoll_conn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nopoll_conn.c b/src/nopoll_conn.c index 6e87baf..4511543 100644 --- a/src/nopoll_conn.c +++ b/src/nopoll_conn.c @@ -2295,8 +2295,8 @@ void nopoll_conn_unref (noPollConn * conn) nopoll_free (conn->handshake->websocket_accept); nopoll_free (conn->handshake->expected_accept); nopoll_free (conn->handshake->cookie); - nopoll_free (conn->handshake); nopoll_free (conn->handshake->redirectURL); + nopoll_free (conn->handshake); } /* end if */ /* release connection options if defined and reuse flag is not defined */ From 7d2150caaac08dc79ba67b47edd82aaca22a8f27 Mon Sep 17 00:00:00 2001 From: akif1716 <107979102+akif1716@users.noreply.github.com> Date: Wed, 24 May 2023 17:28:43 +0200 Subject: [PATCH 2/2] Update nopoll_conn.c adjusted indentation --- src/nopoll_conn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nopoll_conn.c b/src/nopoll_conn.c index 4511543..ca9ca53 100644 --- a/src/nopoll_conn.c +++ b/src/nopoll_conn.c @@ -2296,7 +2296,7 @@ void nopoll_conn_unref (noPollConn * conn) nopoll_free (conn->handshake->expected_accept); nopoll_free (conn->handshake->cookie); nopoll_free (conn->handshake->redirectURL); - nopoll_free (conn->handshake); + nopoll_free (conn->handshake); } /* end if */ /* release connection options if defined and reuse flag is not defined */