summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xutils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/utils.c b/utils.c
index 1ecbc215a..ebe2b3729 100755
--- 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;
}