From 94b0f8f7feceb8f1119ffdb46ebe62c4afcd5403 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 26 Sep 2011 16:28:05 +0200 Subject: s3: Slightly simplify print_kdc_line() No code change except for an early "return talloc_asprintf(..)" making an else branch obsolete. Autobuild-User: Volker Lendecke Autobuild-Date: Mon Sep 26 18:24:25 CEST 2011 on sn-devel-104 --- source3/libads/kerberos.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'source3/libads') diff --git a/source3/libads/kerberos.c b/source3/libads/kerberos.c index e729918b70..5c62ead689 100644 --- a/source3/libads/kerberos.c +++ b/source3/libads/kerberos.c @@ -668,7 +668,6 @@ static char *print_kdc_line(char *mem_ctx, const struct sockaddr_storage *pss, const char *kdc_name) { - char *kdc_str = NULL; char addr[INET6_ADDRSTRLEN]; uint16_t port = get_sockaddr_port(pss); @@ -717,16 +716,15 @@ static char *print_kdc_line(char *mem_ctx, * ipv6 address - gd */ if (kdc_name) { - kdc_str = talloc_asprintf(mem_ctx, "%s\tkdc = %s\n", - prev_line, kdc_name); - } else { - kdc_str = talloc_asprintf(mem_ctx, "%s\tkdc = %s\n", - prev_line, - print_sockaddr(addr, - sizeof(addr), - pss)); + return talloc_asprintf(mem_ctx, "%s\tkdc = %s\n", + prev_line, kdc_name); } - return kdc_str; + + return talloc_asprintf(mem_ctx, "%s\tkdc = %s\n", + prev_line, + print_sockaddr(addr, + sizeof(addr), + pss)); } /************************************************************************ -- cgit