Przeglądaj źródła

votequorum: free newly allocated node if nodeid==0

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
(cherry picked from commit 5458d4f27ad956d23a27a0d83b9cf9a6e36e68d0)
Jan Friesse 14 lat temu
rodzic
commit
ead7fce769
1 zmienionych plików z 5 dodań i 0 usunięć
  1. 5 0
      services/votequorum.c

+ 5 - 0
services/votequorum.c

@@ -1052,6 +1052,11 @@ static void message_handler_req_exec_votequorum_nodeinfo (
 	if (new_node || req_exec_quorum_nodeinfo->first_trans || 
 	if (new_node || req_exec_quorum_nodeinfo->first_trans || 
 	    old_votes != node->votes || old_expected != node->expected_votes || old_state != node->state)
 	    old_votes != node->votes || old_expected != node->expected_votes || old_state != node->state)
 		recalculate_quorum(0, 0);
 		recalculate_quorum(0, 0);
+
+	if (!nodeid) {
+		free(node);
+	}
+
 	LEAVE();
 	LEAVE();
 }
 }