]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Tidy up
authorNick Porter <nick@portercomputing.co.uk>
Tue, 16 Apr 2024 18:37:06 +0000 (19:37 +0100)
committerNick Porter <nick@portercomputing.co.uk>
Wed, 17 Apr 2024 08:57:45 +0000 (09:57 +0100)
src/lib/server/module_rlm.c

index 59ae0680d71028e6f474cd6b339030276af57dfb..b0c063daa35a667673df5961e8d6842829f999d2 100644 (file)
@@ -639,10 +639,7 @@ module_instance_t *module_rlm_by_name_and_method(module_method_t *method, call_e
         *      We have a module, but the caller doesn't care about
         *      method or names, so just return the module.
         */
-       if (!method || !method_name1 || !method_name2) {
-               talloc_free(inst_name);
-               return mi;
-       }
+       if (!method || !method_name1 || !method_name2) goto finish;
 
        /*
         *      We MAY have two names.
@@ -655,8 +652,7 @@ module_instance_t *module_rlm_by_name_and_method(module_method_t *method, call_e
        if (!mrlm->method_names) {
                *name1 = name + (p - inst_name);
                *name2 = NULL;
-               talloc_free(inst_name);
-               return mi;
+               goto finish;
        }
 
        /*
@@ -699,17 +695,13 @@ module_instance_t *module_rlm_by_name_and_method(module_method_t *method, call_e
                /*
                 *      Return the found module.
                 */
-               talloc_free(inst_name);
-               return mi;
+               goto finish;
        }
 
        /*
         *      We CANNOT have '.' in method names.
         */
-       if (strchr(q + 1, '.') != 0) {
-               talloc_free(inst_name);
-               return mi;
-       }
+       if (strchr(q + 1, '.') != 0) goto finish;
 
        len = q - p;