[sr-dev] git:master:51ba40fe: modules/ims_dialog: release lock in error conditions

jaybeepee jason.penton at gmail.com
Fri Feb 12 19:05:27 CET 2016


Module: kamailio
Branch: master
Commit: 51ba40fe5707bcadfa84ac99138537132ee7c0cb
URL: https://github.com/kamailio/kamailio/commit/51ba40fe5707bcadfa84ac99138537132ee7c0cb

Author: jaybeepee <jason.penton at gmail.com>
Committer: jaybeepee <jason.penton at gmail.com>
Date: 2016-02-12T20:03:00+02:00

modules/ims_dialog: release lock in error conditions

---

Modified: modules/ims_dialog/dlg_hash.c

---

Diff:  https://github.com/kamailio/kamailio/commit/51ba40fe5707bcadfa84ac99138537132ee7c0cb.diff
Patch: https://github.com/kamailio/kamailio/commit/51ba40fe5707bcadfa84ac99138537132ee7c0cb.patch

---

diff --git a/modules/ims_dialog/dlg_hash.c b/modules/ims_dialog/dlg_hash.c
index 4de3b32..230e1f4 100644
--- a/modules/ims_dialog/dlg_hash.c
+++ b/modules/ims_dialog/dlg_hash.c
@@ -442,6 +442,7 @@ int dlg_set_leg_info(struct dlg_cell *dlg, str* tag, str *rr, str *contact,
                         dlg_out->callee_contact.s = (char*) shm_malloc(contact->len);
                         if (!dlg_out->callee_contact.s) {
                             LM_ERR("no more shm mem\n");
+							lock_release(dlg->dlg_out_entries_lock);
                             return -1; //if we're out of mem we dont really care about cleaning up - prob going to crash anyway
                         }
                         dlg_out->callee_contact.len = contact->len;
@@ -461,6 +462,7 @@ int dlg_set_leg_info(struct dlg_cell *dlg, str* tag, str *rr, str *contact,
                         dlg_out->caller_cseq.s = (char*) shm_malloc(cseq->len);
                         if (!dlg_out->callee_cseq.s || !dlg_out->caller_cseq.s) {
                             LM_ERR("no more shm mem\n");
+							lock_release(dlg->dlg_out_entries_lock);
                             return -1; //if we're out of mem we dont really care about cleaning up - prob going to crash anyway
                         }
                         dlg_out->caller_cseq.len = cseq->len;




More information about the sr-dev mailing list