Module: kamailio
Branch: master
Commit: a6caaabe4bc85e1b41d5bd9b0b8938069eace309
URL:
https://github.com/kamailio/kamailio/commit/a6caaabe4bc85e1b41d5bd9b0b89380…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2023-04-05T12:55:06+02:00
nats: safety check on destroy for poll field
- GH #3401
---
Modified: src/modules/nats/nats_mod.c
---
Diff:
https://github.com/kamailio/kamailio/commit/a6caaabe4bc85e1b41d5bd9b0b89380…
Patch:
https://github.com/kamailio/kamailio/commit/a6caaabe4bc85e1b41d5bd9b0b89380…
---
diff --git a/src/modules/nats/nats_mod.c b/src/modules/nats/nats_mod.c
index 053ad8c8ba..2f99225728 100644
--- a/src/modules/nats/nats_mod.c
+++ b/src/modules/nats/nats_mod.c
@@ -597,7 +597,9 @@ int nats_destroy_workers()
LM_ERR("could not cleanup worker connection\n");
}
}
- uv_poll_stop(&pub_worker->poll);
+ if(pub_worker->poll != NULL) {
+ uv_poll_stop(&pub_worker->poll);
+ }
shm_free(pub_worker);
}
}