From: Jan Friesse Date: Fri, 6 Apr 2012 10:12:21 +0000 (+0200) Subject: Always allocate totemrrp stats array X-Git-Tag: v2.0.0^0 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=f89d7b715f72dd1134815cc1f920239fd63cb25d;p=mirror_corosync.git Always allocate totemrrp stats array This prevents segfault when rrp mode is set with only one ring. Signed-off-by: Jan Friesse Reviewed-by: Fabio M. Di Nitto --- diff --git a/exec/totemrrp.c b/exec/totemrrp.c index 25ea90b9..de6cd394 100644 --- a/exec/totemrrp.c +++ b/exec/totemrrp.c @@ -1879,10 +1879,8 @@ int totemrrp_initialize ( instance->totem_config = totem_config; stats->rrp = &instance->stats; - if (totem_config->interface_count > 1) { - instance->stats.interface_count = totem_config->interface_count; - instance->stats.faulty = calloc(instance->stats.interface_count, sizeof(uint8_t)); - } + instance->stats.interface_count = totem_config->interface_count; + instance->stats.faulty = calloc(instance->stats.interface_count, sizeof(uint8_t)); res = totemrrp_algorithm_set ( instance->totem_config,