]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Free memory on error
authorAlan T. DeKok <aland@freeradius.org>
Wed, 19 Oct 2011 15:37:16 +0000 (17:37 +0200)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 19 Oct 2011 15:37:16 +0000 (17:37 +0200)
src/main/realms.c

index 57b3f82df104efbdc0cee92f66f93ec66606fa25..b6f7baa9af50d45c193761556297e427a70986ff 100644 (file)
@@ -1753,9 +1753,15 @@ int realms_init(CONF_SECTION *config)
                if (cf_data_find(cs, "home_server_pool")) continue;
 
                type = pool_peek_type(config, cs);
-               if (type == HOME_TYPE_INVALID) return 0;
+               if (type == HOME_TYPE_INVALID) {
+                       free(rc);
+                       realms_free();
+                       return 0;
+               }
 
                if (!server_pool_add(rc, cs, type, TRUE)) {
+                       free(rc);
+                       realms_free();
                        return 0;
                }
        }