From ea4b822af7476ab4ffebb115821564b8c2cab1b0 Mon Sep 17 00:00:00 2001 From: Nicolas Williams Date: Thu, 6 Oct 2022 16:41:35 -0500 Subject: [PATCH] gss: Fix gss-token success exit code --- lib/gssapi/gss-token.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/gssapi/gss-token.c b/lib/gssapi/gss-token.c index 844fa4d38..f3f90521c 100644 --- a/lib/gssapi/gss-token.c +++ b/lib/gssapi/gss-token.c @@ -235,10 +235,9 @@ write_and_free_token(gss_buffer_t out, int negotiate) printf("\n"); if (len < inc) inc = len; - ret = rk_base64_encode(p, inc, &outstr); - if (ret < 0) { + if (rk_base64_encode(p, inc, &outstr) < 0) { fprintf(stderr, "Out of memory.\n"); - ret = 1; + ret = errno; goto bail; } ret = 0; @@ -247,6 +246,7 @@ write_and_free_token(gss_buffer_t out, int negotiate) p += inc; len -= inc; } while (len > 0); + ret = 0; bail: gss_release_buffer(&min, out);