Module: kamailio
Branch: master
Commit: 894e64ae69f485ee8b764092d255c65ab7740da7
URL:
https://github.com/kamailio/kamailio/commit/894e64ae69f485ee8b764092d255c65…
Author: Alex Hermann <alex(a)hexla.nl>
Committer: Alex Hermann <alex(a)hexla.nl>
Date: 2017-09-22T11:56:54+02:00
janssonrcp-c: Fix segfault in mod_destroy
Check variable before dereferencing it.
---
Modified: src/modules/janssonrpcc/janssonrpcc_mod.c
---
Diff:
https://github.com/kamailio/kamailio/commit/894e64ae69f485ee8b764092d255c65…
Patch:
https://github.com/kamailio/kamailio/commit/894e64ae69f485ee8b764092d255c65…
---
diff --git a/src/modules/janssonrpcc/janssonrpcc_mod.c
b/src/modules/janssonrpcc/janssonrpcc_mod.c
index a6e9c010d3..5cdd5f8a5b 100644
--- a/src/modules/janssonrpcc/janssonrpcc_mod.c
+++ b/src/modules/janssonrpcc/janssonrpcc_mod.c
@@ -205,8 +205,10 @@ static int child_init(int rank)
void mod_destroy(void)
{
- lock_get(jsonrpc_server_group_lock); /* blocking */
- if(jsonrpc_server_group_lock) lock_dealloc(jsonrpc_server_group_lock);
+ if(jsonrpc_server_group_lock) {
+ lock_get(jsonrpc_server_group_lock); /* blocking */
+ lock_dealloc(jsonrpc_server_group_lock);
+ }
free_server_group(global_server_group);
CHECK_AND_FREE(global_server_group);