Просмотр исходного кода

votequorum: Properly initialize atb and atb_string

icmap_get_* behavior is to NOT modify passed variable when it doesn't
success. So we must initialize variable before icmap_get_* call.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Jan Friesse 12 лет назад
Родитель
Сommit
e1801ba497
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      exec/votequorum.c

+ 2 - 2
exec/votequorum.c

@@ -1211,9 +1211,9 @@ static char *votequorum_readconfig(int runtime)
 	uint32_t node_votes = 0, qdevice_votes = 0;
 	uint32_t node_expected_votes = 0, expected_votes = 0;
 	uint32_t node_count = 0;
-	uint8_t atb;
+	uint8_t atb = 0;
 	int have_nodelist, have_qdevice;
-	char *atb_string;
+	char *atb_string = NULL;
 	char *error = NULL;
 
 	ENTER();