summaryrefslogtreecommitdiff
path: root/sql/hostname.cc
diff options
context:
space:
mode:
authormonty@hundin.mysql.fi <>2002-05-16 16:32:51 +0300
committermonty@hundin.mysql.fi <>2002-05-16 16:32:51 +0300
commit353fb57b741ee01054a0f2a9eb83c44d0bc4dcd2 (patch)
tree145820cb9685468167f09ba07a59a1f61ca640cf /sql/hostname.cc
parent14b55bcc72554f3f356df4e7b1d8e7c8244de959 (diff)
downloadmariadb-git-353fb57b741ee01054a0f2a9eb83c44d0bc4dcd2.tar.gz
New my_gethostbyname_r() handling
Changed some status variable names Fix bug in GRANT ... PASSWORD string
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 bc812341337..21dbd5a2bbe 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)))