Really fix ast_gethostbyname
authorMark Spencer <markster@digium.com>
Thu, 13 May 2004 21:54:30 +0000 (21:54 +0000)
committerMark Spencer <markster@digium.com>
Thu, 13 May 2004 21:54:30 +0000 (21:54 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2963 65c4cc65-6c06-0410-ace0-fbb531ad65f3

utils.c

diff --git a/utils.c b/utils.c
index 1ecbc21..ebe2b37 100755 (executable)
--- a/utils.c
+++ b/utils.c
@@ -137,7 +137,7 @@ struct hostent *ast_gethostbyname(const char *host, struct ast_hostent *hp)
                return NULL;
        res = gethostbyname_r(host, &hp->hp, hp->buf, sizeof(hp->buf), &result, &herrno);
 
-       if (res || !hp->hp.h_addr_list || !hp->hp.h_addr_list[0])
+       if (res || !result || !hp->hp.h_addr_list || !hp->hp.h_addr_list[0])
                return NULL;
        return &hp->hp;
 }