diff --git a/modules/pv/pv_core.c b/modules/pv/pv_core.c index 9ce9da2198a..71e6ab37e34 100644 --- a/modules/pv/pv_core.c +++ b/modules/pv/pv_core.c @@ -3038,6 +3038,7 @@ int pv_get_expires(sip_msg_t *msg, pv_param_t *param, pv_value_t *res) unsigned int exp_max = 0; hdr_field_t* hdr; contact_t* c; + contact_t* c0; unsigned int eval = 0; unsigned int ehdr = 0; unsigned int efound = 0; @@ -3068,7 +3069,7 @@ int pv_get_expires(sip_msg_t *msg, pv_param_t *param, pv_value_t *res) } c = ((contact_body_t*)hdr->parsed)->contacts; while(c) { - c = c->next; + c0 = c->next; if(c->expires && c->expires->body.len) { if (str2int(&c->expires->body, &eval) < 0) { LM_ERR("failed to parse expires\n"); @@ -3083,6 +3084,7 @@ int pv_get_expires(sip_msg_t *msg, pv_param_t *param, pv_value_t *res) if(eval>exp_max) exp_max = eval; if(evalnext;