Module: sip-router
Branch: master
Commit: 75fc49f74d13774f1ecc0cdd8f0adfe168915b4f
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=75fc49f…
Author: Timo Reimann <timo.reimann(a)1und1.de>
Committer: Timo Reimann <timo.reimann(a)1und1.de>
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.
---
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);
}