Browse code

userblacklist: init variables for safer destroy at startup

- reported by GH#42

(cherry picked from commit c28551cd245f5e8ab9fc5d5c29f657cc06ad81e2)
(cherry picked from commit 23e8ab71c7c6a3baf8858e02391e67f2e8c30c97)

Daniel-Constantin Mierla authored on 28/01/2015 21:02:02
Showing 1 changed files
... ...
@@ -167,7 +167,7 @@ struct source_list_t {
167 167
 
168 168
 static gen_lock_t *lock = NULL;
169 169
 static struct source_list_t *sources = NULL;
170
-static struct dtrie_node_t *dtrie_root;
170
+static struct dtrie_node_t *dtrie_root = NULL;
171 171
 
172 172
 
173 173
 static int check_user_blacklist_fixup(void** param, int param_no)
... ...
@@ -580,7 +580,7 @@ static int init_source_list(void)
580 580
 		SHM_MEM_ERROR;
581 581
 		return -1;
582 582
 	}
583
-	sources->head = NULL;
583
+	memset(sources, 0, sizeof(struct source_list_t));
584 584
 	return 0;
585 585
 }
586 586