Really fix ast_gethostbyname

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2963 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Mark Spencer
2004-05-13 21:54:30 +00:00
parent 50b637d1f9
commit 7254cca9f3

View File

@@ -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;
}