mangler: pkg free in case of errors
[sip-router] / src / modules / mangler / contact_ops.c
index 4e72672..de94edb 100644 (file)
@@ -73,7 +73,11 @@ encode_contact (struct sip_msg *msg, char *encoding_prefix,char *public_ip)
                if (strlen(contact_flds_separator)>=1)
                        separator = contact_flds_separator[0];
        
-       if (msg->contact->parsed == NULL)       parse_contact (msg->contact);
+       if (msg->contact->parsed == NULL) {
+               if(parse_contact (msg->contact)<0) {
+                       LM_DBG("failed to parse contact\n");
+               }
+       }
        if (msg->contact->parsed != NULL)
        {
                cb = (contact_body_t *) msg->contact->parsed;
@@ -188,8 +192,6 @@ decode_contact_header (struct sip_msg *msg,char *unused1,char *unused2)
        str newUri;
        char separator;
        int res;
-       
-       
 
        if ((msg->contact == NULL)&&((parse_headers(msg,HDR_CONTACT_F,0) == -1) || 
                                (msg->contact== NULL) ))
@@ -203,7 +205,11 @@ decode_contact_header (struct sip_msg *msg,char *unused1,char *unused2)
                if (strlen(contact_flds_separator)>=1)
                        separator = contact_flds_separator[0];
                
-       if (msg->contact->parsed == NULL) parse_contact (msg->contact);
+       if (msg->contact->parsed == NULL) {
+               if(parse_contact (msg->contact)<0) {
+                       LM_DBG("failed to parse contact\n");
+               }
+       }
        if (msg->contact->parsed != NULL)
        {
                cb = (contact_body_t *) msg->contact->parsed;