Skip to content

Commit

Permalink
ims_ipsec_pcscf: declare vars at beginning of the block
Browse files Browse the repository at this point in the history
  • Loading branch information
miconda committed Dec 4, 2023
1 parent 812df26 commit 2f98aac
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/modules/ims_ipsec_pcscf/cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -806,6 +806,10 @@ int ipsec_create(struct sip_msg *m, udomain_t *d, int _cflags)
struct pcontact_info ci;
int ret = IPSEC_CMD_FAIL; // FAIL by default
tm_cell_t *t = NULL;
sip_msg_t *req = NULL;
security_t *req_sec_params = NULL;
ipsec_t *s = NULL;
ipsec_t *old_s = NULL;

if(m->first_line.type == SIP_REPLY) {
t = tmb.t_gett();
Expand Down Expand Up @@ -847,12 +851,10 @@ int ipsec_create(struct sip_msg *m, udomain_t *d, int _cflags)
goto cleanup;
}

struct sip_msg *req = t->uas.request;
req = t->uas.request;

// Parse security parameters from the REGISTER request and get some data for the new tunnels
security_t *req_sec_params = cscf_get_security(req);
ipsec_t *s;
ipsec_t *old_s = NULL;
req_sec_params = cscf_get_security(req);

// Update contacts only for initial registration, for re-registration the existing contacts shouldn't be updated.
if(ci.via_port == SIP_PORT
Expand Down

0 comments on commit 2f98aac

Please sign in to comment.