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_2_2_1~274 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=02567cf3c5aa758d7153c0bd7020e27a5067f7c3;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 bb1112d7ec4..eba6f94cc1f 100644 --- a/src/main/modcall.c +++ b/src/main/modcall.c @@ -2005,21 +2005,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; }