From: Arran Cudbard-Bell Date: Tue, 18 Sep 2012 13:15:14 +0000 (+0100) Subject: Don't use ci to iterate over subsections if we might need to use it for logging later X-Git-Tag: release_3_0_0_beta1~1702 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c2e26c70bc6d3d3bd98cc57f14f9d5f46a3a17df;p=thirdparty%2Ffreeradius-server.git Don't use ci to iterate over subsections if we might need to use it for logging later --- diff --git a/src/main/modcall.c b/src/main/modcall.c index 162638b8bb3..5e743347363 100644 --- a/src/main/modcall.c +++ b/src/main/modcall.c @@ -2198,21 +2198,22 @@ static modcallable *do_compile_modsingle(modcallable *parent, * maybe a csingle as a ref? */ if (cf_item_is_section(ci)) { + CONF_ITEM *csi; + cs = cf_itemtosection(ci); + for (csi=cf_item_find_next(cs, NULL); + csi != NULL; + csi=cf_item_find_next(cs, csi)) { - for (ci=cf_item_find_next(cs, NULL); - ci != NULL; - ci=cf_item_find_next(cs, ci)) { - - if (cf_item_is_section(ci)) { - cf_log_err(ci, "Subsection of module instance call not allowed"); + if (cf_item_is_section(csi)) { + cf_log_err(csi, "Subsection of module instance call not allowed"); modcallable_free(&csingle); return NULL; } - if (!cf_item_is_pair(ci)) continue; + if (!cf_item_is_pair(csi)) continue; - if (!compile_action(csingle, cf_itemtopair(ci))) { + if (!compile_action(csingle, cf_itemtopair(csi))) { modcallable_free(&csingle); return NULL; }