gss: Fix gss-token success exit code

This commit is contained in:
Nicolas Williams
2022-10-06 16:41:35 -05:00
parent 5ce580f5ad
commit ea4b822af7

View File

@@ -235,10 +235,9 @@ write_and_free_token(gss_buffer_t out, int negotiate)
printf("\n"); printf("\n");
if (len < inc) if (len < inc)
inc = len; inc = len;
ret = rk_base64_encode(p, inc, &outstr); if (rk_base64_encode(p, inc, &outstr) < 0) {
if (ret < 0) {
fprintf(stderr, "Out of memory.\n"); fprintf(stderr, "Out of memory.\n");
ret = 1; ret = errno;
goto bail; goto bail;
} }
ret = 0; ret = 0;
@@ -247,6 +246,7 @@ write_and_free_token(gss_buffer_t out, int negotiate)
p += inc; p += inc;
len -= inc; len -= inc;
} while (len > 0); } while (len > 0);
ret = 0;
bail: bail:
gss_release_buffer(&min, out); gss_release_buffer(&min, out);