diff options
-rwxr-xr-x | utils.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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; } |