From ef78f203db903f1a0b26d1a20ec8c7f95f9d42d2 Mon Sep 17 00:00:00 2001 From: Danilo Almeida Date: Tue, 8 May 2001 14:29:53 +0000 Subject: [PATCH] * 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 --- src/lib/krb5/os/ChangeLog | 6 ++++++ src/lib/krb5/os/locate_kdc.c | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) 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, -- 2.26.2