summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2011-09-26 16:28:05 +0200
committerVolker Lendecke <vlendec@samba.org>2011-09-26 18:24:25 +0200
commit94b0f8f7feceb8f1119ffdb46ebe62c4afcd5403 (patch)
tree13205984ff93ab40d3346b68786cdc488433f7c2 /source3
parent9411b8e49dc81856f6f34550b81045f83efbe548 (diff)
downloadsamba-94b0f8f7feceb8f1119ffdb46ebe62c4afcd5403.tar.gz
samba-94b0f8f7feceb8f1119ffdb46ebe62c4afcd5403.tar.bz2
samba-94b0f8f7feceb8f1119ffdb46ebe62c4afcd5403.zip
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 <vlendec@samba.org> Autobuild-Date: Mon Sep 26 18:24:25 CEST 2011 on sn-devel-104
Diffstat (limited to 'source3')
-rw-r--r--source3/libads/kerberos.c18
1 files changed, 8 insertions, 10 deletions
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));
}
/************************************************************************