daemon: handle gethostbyname() error
authorRené Scharfe <l.s.r@web.de>
Wed, 1 Oct 2014 10:16:17 +0000 (12:16 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 1 Oct 2014 20:34:53 +0000 (13:34 -0700)
If the user-supplied hostname can't be found then we should not use it.
We already avoid doing that in the non-NO_IPV6 case by checking if the
return value of getaddrinfo() is zero (success). Do the same in the
NO_IPV6 case and make sure the return value of gethostbyname() isn't
NULL before dereferencing this pointer.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
No differences found