From: Swen Schillig Date: Wed, 21 Nov 2018 11:53:30 +0000 (+0100) Subject: librpc: Free krb5 context on error X-Git-Tag: tdb-1.3.17~677 X-Git-Url: http://git.samba.org/samba.git/?p=bbaumbach%2Fsamba-autobuild%2F.git;a=commitdiff_plain;h=1a6451decfbffe10d72ad1c1221a4e9bccf04055 librpc: Free krb5 context on error If the call to krb5_cc_resolve() fails and processing is aborted, the krb5 conext must be free'd before return. Signed-off-by: Swen Schillig Reviewed-by: Andreas Schneider Reviewed-by: Ralph Boehme --- diff --git a/source3/librpc/crypto/gse.c b/source3/librpc/crypto/gse.c index 70e29c27923..2c00ea9bbcb 100644 --- a/source3/librpc/crypto/gse.c +++ b/source3/librpc/crypto/gse.c @@ -236,6 +236,10 @@ static NTSTATUS gse_context_init(TALLOC_CTX *mem_ctx, return NT_STATUS_OK; err_out: + if (gse_ctx->k5ctx) { + krb5_free_context(gse_ctx->k5ctx); + } + TALLOC_FREE(gse_ctx); return status; }