Skip to content

Commit

Permalink
Fixed conditional read on uninitialised value
Browse files Browse the repository at this point in the history
  • Loading branch information
willemt committed Sep 26, 2015
1 parent 1817773 commit 3b91d4b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/raft_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,7 @@ int raft_add_node(raft_server_t* me_, void* udata, int is_self)
me->nodes = (raft_node_t*)realloc(me->nodes, sizeof(raft_node_t*) * me->num_nodes);
me->nodes[me->num_nodes - 1] = raft_node_new(udata);
me->votes_for_me = (int*)realloc(me->votes_for_me, me->num_nodes * sizeof(int));
me->votes_for_me[me->num_nodes - 1] = 0;
if (is_self)
me->nodeid = me->num_nodes - 1;
return 0;
Expand Down

0 comments on commit 3b91d4b

Please sign in to comment.