]> 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:40:09 +0000 (17:40 +0200)
src/main/realms.c

index 1fccac4e66a48b213127662844ce13e7d9a86d79..c820045945afe7e03bfe6f50aae05d36d108d233 100644 (file)
@@ -1945,9 +1945,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;
                }
        }