Check h_addr_list, too
authorMark Spencer <markster@digium.com>
Fri, 7 May 2004 20:18:55 +0000 (20:18 +0000)
committerMark Spencer <markster@digium.com>
Fri, 7 May 2004 20:18:55 +0000 (20:18 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2917 65c4cc65-6c06-0410-ace0-fbb531ad65f3

asterisk.c

index 9106a56..3edefd2 100755 (executable)
@@ -1851,7 +1851,7 @@ struct hostent *ast_gethostbyname(const char *host, struct ast_hostent *hp)
 
        res = gethostbyname_r(host, &hp->hp, hp->buf, sizeof(hp->buf), &result, &herrno);
 
-       if (res || !hp->hp.h_addr)
+       if (res || !hp->hp.h_addr_list || !hp->hp.h_addr_list[0])
                return NULL;
        return &hp->hp;
 }