[sr-dev] git:4.1: modules/pua: added some missing lock releases

Juha Heinanen jh at tutpro.com
Fri Dec 27 10:58:31 CET 2013


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

Author: Juha Heinanen <jh at tutpro.com>
Committer: Juha Heinanen <jh at tutpro.com>
Date:   Thu Dec 26 17:51:04 2013 +0200

modules/pua: added some missing lock releases
(cherry picked from commit 4eb338611e716e7a32f252acbae52bace6047a0a)

---

 modules/pua/send_subscribe.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/modules/pua/send_subscribe.c b/modules/pua/send_subscribe.c
index 006bae4..d568ff2 100644
--- a/modules/pua/send_subscribe.c
+++ b/modules/pua/send_subscribe.c
@@ -1030,8 +1030,12 @@ int send_subscribe(subs_info_t* subs)
 insert:
 	
 		if (subs->expires == 0)
+		{
 			/* Don't create a new dialog when expires == 0 */
-			goto done;	
+       			if (dbmode != PUA_DB_ONLY)
+				lock_release(&HashT->p_records[hash_code].lock);
+			goto done;
+		}
 
 		if(subs->flag & UPDATE_TYPE)
 		{
@@ -1044,6 +1048,8 @@ insert:
 		{
 			LM_ERR("while building callback"
 					" param\n");
+       			if (dbmode != PUA_DB_ONLY)
+				lock_release(&HashT->p_records[hash_code].lock);
 			goto error;
 		}
 		hentity->flag= flag;
@@ -1068,6 +1074,8 @@ insert:
 				uac_r.dialog = 0;
 			}
 			shm_free(hentity);
+       			if (dbmode != PUA_DB_ONLY)
+				lock_release(&HashT->p_records[hash_code].lock);
 
 			/* Although this is an error must not return -1 as the
 			   calling function must continue processing. */
@@ -1089,6 +1097,8 @@ insert:
 		if(presentity== NULL)
 		{
 			LM_ERR("no more share memory\n");
+       			if (dbmode != PUA_DB_ONLY)
+				lock_release(&HashT->p_records[hash_code].lock);
 			goto error;
 		}
 		memset(presentity, 0, size);




More information about the sr-dev mailing list