Module: kamailio
Branch: master
Commit: d315eb26c1e4b9fcb4b9696f3b6492b2131ccf1b
URL:
https://github.com/kamailio/kamailio/commit/d315eb26c1e4b9fcb4b9696f3b6492b…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2022-11-28T14:27:34+01:00
nats: declare variable at beginning of function
---
Modified: src/modules/nats/nats_mod.c
---
Diff:
https://github.com/kamailio/kamailio/commit/d315eb26c1e4b9fcb4b9696f3b6492b…
Patch:
https://github.com/kamailio/kamailio/commit/d315eb26c1e4b9fcb4b9696f3b6492b…
---
diff --git a/src/modules/nats/nats_mod.c b/src/modules/nats/nats_mod.c
index 5285158ec8..de03399de3 100644
--- a/src/modules/nats/nats_mod.c
+++ b/src/modules/nats/nats_mod.c
@@ -530,6 +530,7 @@ int nats_cleanup_init_servers()
int nats_cleanup_connection(nats_connection_ptr c)
{
+ int s;
if(c->conn != NULL) {
natsConnection_Close(c->conn);
natsConnection_Destroy(c->conn);
@@ -537,7 +538,7 @@ int nats_cleanup_connection(nats_connection_ptr c)
if(c->opts != NULL) {
natsOptions_Destroy(c->opts);
}
- for(int s = 0; s < NATS_MAX_SERVERS; s++) {
+ for(s = 0; s < NATS_MAX_SERVERS; s++) {
if(c->servers[s]) {
shm_free(c->servers[s]);
}