Browse code

userblacklist: init variables for safer destroy at startup

- reported by GH#42

Daniel-Constantin Mierla authored on 28/01/2015 21:02:02
Showing 1 changed files
... ...
@@ -169,7 +169,7 @@ struct source_list_t {
169 169
 
170 170
 static gen_lock_t *lock = NULL;
171 171
 static struct source_list_t *sources = NULL;
172
-static struct dtrie_node_t *dtrie_root;
172
+static struct dtrie_node_t *dtrie_root = NULL;
173 173
 
174 174
 
175 175
 static int check_user_blacklist_fixup(void** param, int param_no)
... ...
@@ -627,7 +627,7 @@ static int init_source_list(void)
627 627
 		SHM_MEM_ERROR;
628 628
 		return -1;
629 629
 	}
630
-	sources->head = NULL;
630
+	memset(sources, 0, sizeof(struct source_list_t));
631 631
 	return 0;
632 632
 }
633 633