Module: kamailio
Branch: master
Commit: 2f98aaca9e4b71b8086abce4c2b41c215fb2a26f
URL:
https://github.com/kamailio/kamailio/commit/2f98aaca9e4b71b8086abce4c2b41c2…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2023-12-04T20:33:40+01:00
ims_ipsec_pcscf: declare vars at beginning of the block
---
Modified: src/modules/ims_ipsec_pcscf/cmd.c
---
Diff:
https://github.com/kamailio/kamailio/commit/2f98aaca9e4b71b8086abce4c2b41c2…
Patch:
https://github.com/kamailio/kamailio/commit/2f98aaca9e4b71b8086abce4c2b41c2…
---
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