[2/3] alfred: Always initialize orig cache hash pointer

Message ID 20170601062632.4239-2-sven@narfation.org (mailing list archive)
State Accepted, archived
Commit e9d68a1ebe7bf743ddce3f269cf00465969a5bd2
Headers
Series [1/3] alfred: Check if tg hash was really initialized |

Commit Message

Sven Eckelmann June 1, 2017, 6:26 a.m. UTC
  The initialization of the cache can be disabled when mesh interface is
"none". We must therefore make sure that the remaining code is not
accessing the uninitialized pointer to the originator cache.

Fixes: e50d18c39f92 ("alfred: Cache the TQ values for each originator")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
 server.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Patch

diff --git a/server.c b/server.c
index 9774281..e7f691c 100644
--- a/server.c
+++ b/server.c
@@ -224,7 +224,7 @@  static void update_server_info(struct globals *globals)
 	struct interface *interface;
 	struct ether_addr *macaddr;
 	struct hashtable_t *tg_hash;
-	struct hashtable_t *orig_hash;
+	struct hashtable_t *orig_hash = NULL;
 
 	/* TQ is not used for master sync mode */
 	if (globals->opmode == OPMODE_MASTER)