mirror of
https://git.jami.net/savoirfairelinux/jami-daemon.git
synced 2025-08-07 22:02:12 +08:00
contrib/pjproject: Fix another socket leak
Change-Id: I8c834ea5abefc1f61996ab5098f1d7caf74e36dc
This commit is contained in:

committed by
Sébastien Blin

parent
97964808a7
commit
a137120903
@ -1,16 +1,16 @@
|
||||
From a9b3b09128d1e96cfa4a8ccc74d406c5bf1895db Mon Sep 17 00:00:00 2001
|
||||
From c1093eeb18a4090fd7eac6e8e70a6da1777f0907 Mon Sep 17 00:00:00 2001
|
||||
From: Olivier Dion <olivier.dion@savoirfairelinux.com>
|
||||
Date: Mon, 19 Jul 2021 16:49:28 -0400
|
||||
Subject: [PATCH] pjnath/turn_sock: Fix leak of socket
|
||||
Date: Mon, 26 Jul 2021 09:52:50 -0400
|
||||
Subject: [PATCH] pjnath/turn_sock: Fix leak of socket
|
||||
|
||||
Opened socket is not closed on binding and quality of service error. The socket
|
||||
is owned by the active sock only if everything went well.
|
||||
---
|
||||
pjnath/src/pjnath/turn_sock.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
pjnath/src/pjnath/turn_sock.c | 7 +++++++
|
||||
1 file changed, 7 insertions(+)
|
||||
|
||||
diff --git a/pjnath/src/pjnath/turn_sock.c b/pjnath/src/pjnath/turn_sock.c
|
||||
index dc6304d9f..b41e32220 100644
|
||||
index dc6304d9f..a453f5b65 100644
|
||||
--- a/pjnath/src/pjnath/turn_sock.c
|
||||
+++ b/pjnath/src/pjnath/turn_sock.c
|
||||
@@ -1195,6 +1195,7 @@ static void turn_on_state(pj_turn_session *sess,
|
||||
@ -29,6 +29,17 @@ index dc6304d9f..b41e32220 100644
|
||||
pj_turn_sock_destroy(turn_sock);
|
||||
return;
|
||||
}
|
||||
@@ -1262,6 +1264,11 @@ static void turn_on_state(pj_turn_session *sess,
|
||||
turn_sock->cfg.ioqueue, &asock_cb,
|
||||
turn_sock,
|
||||
&turn_sock->active_sock);
|
||||
+
|
||||
+ /* Active socket failed to take ownership of `sock` */
|
||||
+ if (status != PJ_SUCCESS) {
|
||||
+ pj_sock_close(sock);
|
||||
+ }
|
||||
}
|
||||
#if PJ_HAS_SSL_SOCK
|
||||
else {
|
||||
--
|
||||
2.32.0
|
||||
|
||||
|
Reference in New Issue
Block a user