summaryrefslogtreecommitdiff
path: root/sql/hostname.cc
diff options
context:
space:
mode:
authormonty@hundin.mysql.fi <>2002-05-16 18:20:49 +0300
committermonty@hundin.mysql.fi <>2002-05-16 18:20:49 +0300
commitf5ed8784a24f12262bd01be3df63d5c891adf306 (patch)
tree12de711f3f9d8ad9eee9d28cf71e5487f17315d3 /sql/hostname.cc
parent4ca4f4788b2a591d52cdb5e0fe69aee2b09975ac (diff)
parentf092818715de15211638b8fd0913f151417d3450 (diff)
downloadmariadb-git-f5ed8784a24f12262bd01be3df63d5c891adf306.tar.gz
merge with 3.23.51
Diffstat (limited to 'sql/hostname.cc')
-rw-r--r--sql/hostname.cc7
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)))