]> git.proxmox.com Git - mirror_corosync.git/commitdiff
Always allocate totemrrp stats array v2.0.0
authorJan Friesse <jfriesse@redhat.com>
Fri, 6 Apr 2012 10:12:21 +0000 (12:12 +0200)
committerJan Friesse <jfriesse@redhat.com>
Tue, 10 Apr 2012 07:08:42 +0000 (09:08 +0200)
This prevents segfault when rrp mode is set with only one ring.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
exec/totemrrp.c

index 25ea90b99e4506654740ee7906b09558c2f64e36..de6cd394ed5cc73cba8f40c60b424feb89f9bf32 100644 (file)
@@ -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,