redis: init variables to get rid of compile warnings
authorDaniel-Constantin Mierla <miconda@gmail.com>
Mon, 27 Apr 2020 07:36:36 +0000 (09:36 +0200)
committerDaniel-Constantin Mierla <miconda@gmail.com>
Mon, 27 Apr 2020 07:36:36 +0000 (09:36 +0200)
- GH #2298

src/modules/db_redis/redis_table.c

index a35e7dc..e59bd5b 100644 (file)
@@ -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;