[sr-dev] git:master:f1de08ee: redis: init variables to get rid of compile warnings

Daniel-Constantin Mierla miconda at gmail.com
Mon Apr 27 09:42:11 CEST 2020


Module: kamailio
Branch: master
Commit: f1de08eef86dc2cd98509c90fa8b28212d47ca37
URL: https://github.com/kamailio/kamailio/commit/f1de08eef86dc2cd98509c90fa8b28212d47ca37

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2020-04-27T09:36:36+02:00

redis: init variables to get rid of compile warnings

- GH #2298

---

Modified: src/modules/db_redis/redis_table.c

---

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

---

diff --git a/src/modules/db_redis/redis_table.c b/src/modules/db_redis/redis_table.c
index a35e7dc786..e59bd5ba29 100644
--- a/src/modules/db_redis/redis_table.c
+++ b/src/modules/db_redis/redis_table.c
@@ -496,13 +496,13 @@ int db_redis_parse_keys(km_redis_con_t *con) {
     str column_name;
     str version_code;
 
-    struct str_hash_entry *table_entry;
-    redis_table_t *table;
-    redis_type_t *type;
-    redis_type_t *type_target;
-    redis_key_t *key;
-    redis_key_t **key_target;
-    redis_key_t *key_location;
+    struct str_hash_entry *table_entry = NULL;
+    redis_table_t *table = NULL;
+    redis_type_t *type = NULL;
+    redis_type_t *type_target = NULL;
+    redis_key_t *key = NULL;
+    redis_key_t **key_target = NULL;
+    redis_key_t *key_location = NULL;
 
     enum {
         DBREDIS_KEYS_TABLE_ST,
@@ -657,13 +657,13 @@ int db_redis_parse_schema(km_redis_con_t *con) {
     struct dirent* dent;
     char *dir_name;
 
-    str table_name;
+    str table_name = str_init("");
     str column_name;
     str type_name;
 
-    struct str_hash_entry *table_entry;
-    struct str_hash_entry *column_entry;
-    redis_table_t *table;
+    struct str_hash_entry *table_entry = NULL;
+    struct str_hash_entry *column_entry = NULL;
+    redis_table_t *table = NULL;
 
     char full_path[_POSIX_PATH_MAX + 1];
     int path_len;




More information about the sr-dev mailing list