]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
"case" can only occur within a "switch"
authorAlan T. DeKok <aland@freeradius.org>
Mon, 30 Sep 2013 19:50:21 +0000 (15:50 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 30 Sep 2013 19:50:21 +0000 (15:50 -0400)
src/main/modcall.c

index fedea674e9cf6db3bbf99e5be92401cb4a9cfc2b..ca958a232bb84754bac4b279c11baa6640ef1131 100644 (file)
@@ -1882,11 +1882,8 @@ static modcallable *do_compile_modsingle(modcallable *parent,
 
                        *modname = name2;
 
-                       /*
-                        *      FIXME: How to tell that the parent can only
-                        *      be a "switch" statement?
-                        */
-                       if (!parent) {
+                       if (!parent ||
+                           (parent->type != MOD_SWITCH)) {
                                cf_log_err(ci, "\"case\" statements may only appear within a \"switch\" section");
                                return NULL;
                        }