fixed leak in host_create_from_string("%any")
This commit is contained in:
@@ -392,13 +392,15 @@ static private_host_t *host_create_empty(void)
|
|||||||
*/
|
*/
|
||||||
host_t *host_create_from_string(char *string, u_int16_t port)
|
host_t *host_create_from_string(char *string, u_int16_t port)
|
||||||
{
|
{
|
||||||
private_host_t *this = host_create_empty();
|
private_host_t *this;
|
||||||
|
|
||||||
if (streq(string, "%any"))
|
if (streq(string, "%any"))
|
||||||
{
|
{
|
||||||
return host_create_any(AF_INET);
|
return host_create_any(AF_INET);
|
||||||
}
|
}
|
||||||
else if (strchr(string, '.'))
|
|
||||||
|
this = host_create_empty();
|
||||||
|
if (strchr(string, '.'))
|
||||||
{
|
{
|
||||||
this->address.sa_family = AF_INET;
|
this->address.sa_family = AF_INET;
|
||||||
}
|
}
|
||||||
@@ -406,7 +408,6 @@ host_t *host_create_from_string(char *string, u_int16_t port)
|
|||||||
{
|
{
|
||||||
this->address.sa_family = AF_INET6;
|
this->address.sa_family = AF_INET6;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (this->address.sa_family)
|
switch (this->address.sa_family)
|
||||||
{
|
{
|
||||||
case AF_INET:
|
case AF_INET:
|
||||||
|
|||||||
Reference in New Issue
Block a user