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

Author: Timo Reimann <[email protected]>
Committer: Timo Reimann <[email protected]>
Date:   Tue Nov  2 19:06:12 2010 +0100

modules_k/dialog: Enhance unref_dlg_from_cb() robustness.

- Check parameter for NULL pointer.
- Call unreference_dlg(), thus being more wrapper-ish.
- Fix indention.
(cherry picked from commit 75fc49f74d13774f1ecc0cdd8f0adfe168915b4f)

---

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

diff --git a/modules_k/dialog/dlg_handlers.c b/modules_k/dialog/dlg_handlers.c
index ebed8a9..a118a91 100644
--- a/modules_k/dialog/dlg_handlers.c
+++ b/modules_k/dialog/dlg_handlers.c
@@ -820,10 +820,13 @@ static void unreference_dialog(void *dialog)
  */
 static void unref_dlg_from_cb(struct cell* t, int type, struct tmcb_params 
*param)
 {
-    struct dlg_cell *dlg = (struct dlg_cell *)(*param->param);
+       struct dlg_cell *dlg = (struct dlg_cell *)(*param->param);
+
+       if (!dlg)
+               return;
 
        /* destroy dialog */
-    unref_dlg(dlg, 1);
+       unreference_dialog(dlg);
 }
 
 


_______________________________________________
sr-dev mailing list
[email protected]
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to