[sr-dev] git:4.2:0421282a: permissions: init global pointer variables to null for safe shutdown at start

Daniel-Constantin Mierla miconda at gmail.com
Wed Jan 28 13:46:38 CET 2015


Module: kamailio
Branch: 4.2
Commit: 0421282a10446dd67236b6d4c7d103ee45301c28
URL: https://github.com/kamailio/kamailio/commit/0421282a10446dd67236b6d4c7d103ee45301c28

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2015-01-28T13:39:47+01:00

permissions: init global pointer variables to null for safe shutdown at start

- reported by Olle E. Johansson, GH#41

(cherry picked from commit 165a3fc2e4dfed09bd9f46e43270d49cf5f72a87)

---

Modified: modules/permissions/address.c

---

Diff:  https://github.com/kamailio/kamailio/commit/0421282a10446dd67236b6d4c7d103ee45301c28.diff
Patch: https://github.com/kamailio/kamailio/commit/0421282a10446dd67236b6d4c7d103ee45301c28.patch

---

diff --git a/modules/permissions/address.c b/modules/permissions/address.c
index 45eecf6..7ad0fb5 100644
--- a/modules/permissions/address.c
+++ b/modules/permissions/address.c
@@ -46,17 +46,17 @@
 
 #define TABLE_VERSION 6
 
-struct addr_list ***addr_hash_table; /* Ptr to current hash table ptr */
-struct addr_list **addr_hash_table_1;     /* Pointer to hash table 1 */
-struct addr_list **addr_hash_table_2;     /* Pointer to hash table 2 */
+struct addr_list ***addr_hash_table = NULL; /* Ptr to current hash table ptr */
+struct addr_list **addr_hash_table_1 = NULL; /* Pointer to hash table 1 */
+struct addr_list **addr_hash_table_2 = NULL; /* Pointer to hash table 2 */
 
-struct subnet **subnet_table;        /* Ptr to current subnet table */
-struct subnet *subnet_table_1;       /* Ptr to subnet table 1 */
-struct subnet *subnet_table_2;       /* Ptr to subnet table 2 */
+struct subnet **subnet_table = NULL;  /* Ptr to current subnet table */
+struct subnet *subnet_table_1 = NULL; /* Ptr to subnet table 1 */
+struct subnet *subnet_table_2 = NULL; /* Ptr to subnet table 2 */
 
-struct domain_name_list ***domain_list_table;        /* Ptr to current domain name table */
-static struct domain_name_list **domain_list_table_1;       /* Ptr to domain name table 1 */
-static struct domain_name_list **domain_list_table_2;       /* Ptr to domain name table 2 */
+struct domain_name_list ***domain_list_table = NULL; /* Ptr to current domain name table */
+static struct domain_name_list **domain_list_table_1 = NULL; /* Ptr to domain name table 1 */
+static struct domain_name_list **domain_list_table_2 = NULL; /* Ptr to domain name table 2 */
 
 
 static db1_con_t* db_handle = 0;




More information about the sr-dev mailing list