From: Alan T. DeKok Date: Wed, 19 Oct 2011 15:37:16 +0000 (+0200) Subject: Free memory on error X-Git-Tag: release_2_2_0~290 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e64329cf719424b32e9fb0971d0f44e3244a7efe;p=thirdparty%2Ffreeradius-server.git Free memory on error --- diff --git a/src/main/realms.c b/src/main/realms.c index 57b3f82df10..b6f7baa9af5 100644 --- a/src/main/realms.c +++ b/src/main/realms.c @@ -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; } }