Jelajahi Sumber

db_redis: init allocated redis table structure

(cherry picked from commit e24df12d10d8b88582907481d161c6a2db5cf8f1)
(cherry picked from commit d015ee9c06a8cb6644101d08e4b54f80b96accf6)
Daniel-Constantin Mierla 1 tahun lalu
induk
melakukan
17907f4137
1 mengubah file dengan 1 tambahan dan 2 penghapusan
  1. 1 2
      src/modules/db_redis/redis_table.c

+ 1 - 2
src/modules/db_redis/redis_table.c

@@ -433,8 +433,7 @@ static struct str_hash_entry *db_redis_create_table(str *table)
 		pkg_free(e);
 		return NULL;
 	}
-	t->entry_keys = NULL;
-	t->types = NULL;
+	memset(t, 0, sizeof(redis_table_t));
 
 	if(str_hash_alloc(&t->columns, REDIS_HT_SIZE) != 0) {
 		LM_ERR("Failed to allocate memory for table schema hashtable\n");