From 2f98aaca9e4b71b8086abce4c2b41c215fb2a26f Mon Sep 17 00:00:00 2001 From: Daniel-Constantin Mierla Date: Mon, 4 Dec 2023 20:33:40 +0100 Subject: [PATCH] ims_ipsec_pcscf: declare vars at beginning of the block --- src/modules/ims_ipsec_pcscf/cmd.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/modules/ims_ipsec_pcscf/cmd.c b/src/modules/ims_ipsec_pcscf/cmd.c index 80a714559ba..de61ad7cf6b 100644 --- a/src/modules/ims_ipsec_pcscf/cmd.c +++ b/src/modules/ims_ipsec_pcscf/cmd.c @@ -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(); @@ -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