From 8d35a660e46b7fb2d05bd1dd1844c882c2aae54c Mon Sep 17 00:00:00 2001 From: Danny Al-Gaaf Date: Wed, 27 Feb 2013 18:53:28 +0100 Subject: [PATCH] crush/builder.c: reduce scope of oldsize in crush_add_rule() Signed-off-by: Danny Al-Gaaf --- src/crush/builder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/crush/builder.c b/src/crush/builder.c index 880c8090243..5b5f58a4708 100644 --- a/src/crush/builder.c +++ b/src/crush/builder.c @@ -55,7 +55,6 @@ void crush_finalize(struct crush_map *map) int crush_add_rule(struct crush_map *map, struct crush_rule *rule, int ruleno) { __u32 r; - int oldsize; if (ruleno < 0) { for (r=0; r < map->max_rules; r++) @@ -68,6 +67,7 @@ int crush_add_rule(struct crush_map *map, struct crush_rule *rule, int ruleno) if (r >= map->max_rules) { /* expand array */ + int oldsize; oldsize = map->max_rules; map->max_rules = r+1; map->rules = realloc(map->rules, map->max_rules * sizeof(map->rules[0])); -- 2.47.3