From: Alan T. DeKok Date: Sat, 2 Mar 2013 15:30:38 +0000 (-0500) Subject: Use talloc for hs_type X-Git-Tag: release_3_0_0_beta1~869 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f0c4a14eb32f3de3dbf3fc298734de5dc833b3af;p=thirdparty%2Ffreeradius-server.git Use talloc for hs_type We'll probably need to audit the source for similar issues. Or, simply convert everything to talloc, and the problems will go away. --- diff --git a/src/main/realms.c b/src/main/realms.c index c0b2fca2ae7..7f56349472d 100644 --- a/src/main/realms.c +++ b/src/main/realms.c @@ -487,7 +487,7 @@ static int home_server_add(realm_config_t *rc, CONF_SECTION *cs) "No ipaddr, ipv6addr, or virtual_server defined for home server \"%s\".", name2); error: - free(hs_type); + talloc_free(hs_type); hs_type = NULL; hs_check = NULL; hs_srcipaddr = NULL; @@ -522,7 +522,7 @@ static int home_server_add(realm_config_t *rc, CONF_SECTION *cs) * Use a reasonable default. */ skip_port: - if (!hs_type) hs_type = strdup("auth+acct"); + if (!hs_type) hs_type = talloc_strdup(cs, "auth+acct"); if (strcasecmp(hs_type, "auth") == 0) { home->type = HOME_TYPE_AUTH; @@ -552,6 +552,7 @@ static int home_server_add(realm_config_t *rc, CONF_SECTION *cs) hs_type, name2); goto error; } + if (hs_type) talloc_free(hs_type); hs_type = NULL; if (!hs_check || (strcasecmp(hs_check, "none") == 0)) {