[sr-dev] git:3.2: modules_k/pua: Fixed occasional seg fault in PUA

Peter Dunkley peter.dunkley at crocodile-rcs.com
Mon Jan 30 12:34:22 CET 2012


Module: sip-router
Branch: 3.2
Commit: 28a5c122372d9c15d9db1514d3921a98edf9eee6
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=28a5c122372d9c15d9db1514d3921a98edf9eee6

Author: pd <peter.dunkley at crocodile-rcs.com>
Committer: pd <peter.dunkley at crocodile-rcs.com>
Date:   Mon Jan 30 11:28:59 2012 +0000

modules_k/pua: Fixed occasional seg fault in PUA

- This was added by the fix to the race hazards
  (Commit ID: e627bc31776b521a1078b2a004e8ed179521cae2)
- It only happens in certain error situations (which should not occur anyway -
  these are under investigation now) and was found during an over-weekend
  soak test.
- Found and fixed by Paul Pankhurst @ Crocodile RCS
(cherry picked from commit 6d30bd740303677711de437c4a3fec15da7344a8)

---

 modules_k/pua/send_subscribe.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/modules_k/pua/send_subscribe.c b/modules_k/pua/send_subscribe.c
index c4caad1..86c651d 100644
--- a/modules_k/pua/send_subscribe.c
+++ b/modules_k/pua/send_subscribe.c
@@ -627,8 +627,11 @@ done:
 	goto end;
 
 error:	
-	if (presentity->remote_contact.s) shm_free(presentity->remote_contact.s);
-	if (presentity) shm_free(presentity);
+        if (presentity)
+	{
+		if (presentity->remote_contact.s) shm_free(presentity->remote_contact.s);
+	 	shm_free(presentity);
+	}
 
 end:
 	if(hentity)




More information about the sr-dev mailing list