From: Danilo Almeida Date: Tue, 8 May 2001 14:29:53 +0000 (+0000) Subject: * locate_kdc.c (add_host_to_list): Initialize stack variable err X-Git-Tag: krb5-1.3-alpha1~1516 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ef78f203db903f1a0b26d1a20ec8c7f95f9d42d2;p=krb5.git * locate_kdc.c (add_host_to_list): Initialize stack variable err which would otherwise get returned without being set in certain circumstances. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13235 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/os/ChangeLog b/src/lib/krb5/os/ChangeLog index 244267ba3..2aa21e6f9 100644 --- a/src/lib/krb5/os/ChangeLog +++ b/src/lib/krb5/os/ChangeLog @@ -1,3 +1,9 @@ +2001-05-08 Danilo Almeida + + * locate_kdc.c (add_host_to_list): Initialize stack variable err + which would otherwise get returned without being set in certain + circumstances. + 2001-05-07 Ken Raeburn * locate_kdc.c (add_sockaddr_to_list) [TEST]: If getnameinfo is diff --git a/src/lib/krb5/os/locate_kdc.c b/src/lib/krb5/os/locate_kdc.c index 7b6ec221b..c518c1f1f 100644 --- a/src/lib/krb5/os/locate_kdc.c +++ b/src/lib/krb5/os/locate_kdc.c @@ -286,7 +286,9 @@ add_host_to_list (struct addrlist *lp, const char *hostname, #else struct hostent *hp; #endif - int err; + /* Must set err to 0 for the case we return err without ever + setting it -- !HAVE_GETADDRINFO and !hp */ + int err = 0; #ifdef TEST fprintf (stderr, "adding hostname %s, ports %d,%d\n", hostname,