diff --git a/src/lb_chash.c b/src/lb_chash.c index a35351e96..0bf4e81a2 100644 --- a/src/lb_chash.c +++ b/src/lb_chash.c @@ -84,7 +84,7 @@ static inline void chash_queue_dequeue_srv(struct server *s) * increased the weight beyond the original weight */ if (s->lb_nodes_tot < s->next_eweight) { - struct tree_occ *new_nodes = realloc(s->lb_nodes, s->next_eweight); + struct tree_occ *new_nodes = realloc(s->lb_nodes, s->next_eweight * sizeof(*new_nodes)); if (new_nodes) { unsigned int j;