From fc964cd545c7acbfb67781f325cb3067ebacfd0a Mon Sep 17 00:00:00 2001 From: Nicolas Williams Date: Thu, 2 Dec 2021 21:32:27 -0600 Subject: [PATCH] klist: Fix warnings --- kadmin/kadm_conn.c | 9 +++------ kuser/klist.c | 1 - 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/kadmin/kadm_conn.c b/kadmin/kadm_conn.c index 0817b7c93..0eeaf508d 100644 --- a/kadmin/kadm_conn.c +++ b/kadmin/kadm_conn.c @@ -261,12 +261,9 @@ start_server(krb5_context contextp, const char *port_str) for(ap = ai; ap; ap = ap->ai_next) i++; tmp = realloc(socks, (num_socks + i) * sizeof(*socks)); - if(tmp == NULL) { - krb5_warnx(contextp, "failed to reallocate %lu bytes", - (unsigned long)(num_socks + i) * sizeof(*socks)); - freeaddrinfo(ai); - continue; - } + if(tmp == NULL) + krb5_err(contextp, 1, errno, "failed to reallocate %lu bytes", + (unsigned long)(num_socks + i) * sizeof(*socks)); socks = tmp; for(ap = ai; ap; ap = ap->ai_next) { krb5_socket_t s = socket(ap->ai_family, ap->ai_socktype, ap->ai_protocol); diff --git a/kuser/klist.c b/kuser/klist.c index 5dbabcaad..049b87293 100644 --- a/kuser/klist.c +++ b/kuser/klist.c @@ -362,7 +362,6 @@ print_tickets(krb5_context context, if (ret) krb5_err(context, 1, ret, "krb5_cc_end_seq_get"); - print_comma = 0; if(!do_verbose) { rtbl_format(ct, stdout); rtbl_destroy(ct);