fix crash on query_progress initializer (#16885)
Costa Tsaousis committed
Jan 31, 2024 at 12:31 UTC
8a45c1c3bea116e75816f003d26702d9fdda2441
1 file changed
+2
-2
libnetdata/query_progress/progress.c
+2
-2
@@ -71,7 +71,8 @@ static struct progress {
71
SIMPLE_HASHTABLE_QUERY hashtable;
72
73
} progress = {
74
- .initialized = false,
74
+ .initialized = false,
75
+ .spinlock = NETDATA_SPINLOCK_INITIALIZER,
76
};
77
78
SIMPLE_HASHTABLE_HASH query_hash(uuid_t *transaction) {
@@ -85,7 +86,6 @@ SIMPLE_HASHTABLE_HASH query_hash(uuid_t *transaction) {
86
87
static void query_progress_init_unsafe(void) {
88
if(!progress.initialized) {
88
- memset(&progress, 0, sizeof(progress));
89
simple_hashtable_init_QUERY(&progress.hashtable, PROGRESS_CACHE_SIZE * 4);
90
progress.initialized = true;
91
}