Module: sip-router
Branch: 4.0
Commit: 3f1f50068b96ea4bde1a7255842bf07683cbed8a
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=3f1f500…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Tue Jun 11 18:37:32 2013 +0200
registrar: more debug messages when adding ruid xavp
- free local ruid xavp if cannot be added to root list
(cherry picked from commit 9589466916305146fb4f982542c3f3a51126dcef)
---
modules/registrar/reply.c | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/modules/registrar/reply.c b/modules/registrar/reply.c
index 7ed2a05..4b35a47 100644
--- a/modules/registrar/reply.c
+++ b/modules/registrar/reply.c
@@ -341,7 +341,9 @@ int build_contact(sip_msg_t *msg, ucontact_t* c, str *host)
memset(&xval, 0, sizeof(sr_xval_t));
xval.type = SR_XTYPE_STR;
xval.v.s = c->ruid;
- xavp_add_value(&xname, &xval, &xavp);
+ if(xavp_add_value(&xname, &xval, &xavp)==NULL) {
+ LM_ERR("cannot add ruid value to xavp\n");
+ }
}
}
@@ -351,12 +353,15 @@ int build_contact(sip_msg_t *msg, ucontact_t* c, str *host)
/* add xavp with details of the record (ruid, ...) */
if(reg_xavp_rcd.s!=NULL)
{
- if(list==NULL)
+ if(list==NULL && xavp!=NULL)
{
/* no reg_xavp_rcd xavp in root list - add it */
xval.type = SR_XTYPE_XAVP;
xval.v.xavp = xavp;
- xavp_add_value(®_xavp_rcd, &xval, NULL);
+ if(xavp_add_value(®_xavp_rcd, &xval, NULL)==NULL) {
+ LM_ERR("cannot add ruid xavp to root list\n");
+ xavp_destroy_list(&xavp);
+ }
}
}