diff options
author | monty@hundin.mysql.fi <> | 2002-05-16 18:20:49 +0300 |
---|---|---|
committer | monty@hundin.mysql.fi <> | 2002-05-16 18:20:49 +0300 |
commit | f5ed8784a24f12262bd01be3df63d5c891adf306 (patch) | |
tree | 12de711f3f9d8ad9eee9d28cf71e5487f17315d3 /sql/hostname.cc | |
parent | 4ca4f4788b2a591d52cdb5e0fe69aee2b09975ac (diff) | |
parent | f092818715de15211638b8fd0913f151417d3450 (diff) | |
download | mariadb-git-f5ed8784a24f12262bd01be3df63d5c891adf306.tar.gz |
merge with 3.23.51
Diffstat (limited to 'sql/hostname.cc')
-rw-r--r-- | sql/hostname.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sql/hostname.cc b/sql/hostname.cc index 7d4e4a8ca75..5359f876522 100644 --- a/sql/hostname.cc +++ b/sql/hostname.cc @@ -171,17 +171,22 @@ my_string ip_to_hostname(struct in_addr *in, uint *errors) { DBUG_PRINT("error",("gethostbyname_r returned %d",tmp_errno)); add_wrong_ip(in); + my_gethostbyname_r_free(); DBUG_RETURN(0); } if (!hp->h_name[0]) { DBUG_PRINT("error",("Got an empty hostname")); add_wrong_ip(in); + my_gethostbyname_r_free(); DBUG_RETURN(0); // Don't allow empty hostnames } if (!(name=my_strdup(hp->h_name,MYF(0)))) + { + my_gethostbyname_r_free(); DBUG_RETURN(0); // out of memory - + } + my_gethostbyname_r_free(); #else VOID(pthread_mutex_lock(&LOCK_hostname)); if (!(hp=gethostbyaddr((char*) in,sizeof(*in), AF_INET))) |