From 7acf94dd1b0d0e33be5124bf706a6c3c497810a9 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 8 Nov 2011 15:35:20 -0500 Subject: [PATCH] [libtirpc] fixing memory leak on gss context initiation failure --- libtirpc/src/auth_sspi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libtirpc/src/auth_sspi.c b/libtirpc/src/auth_sspi.c index ac39304..5a993c0 100644 --- a/libtirpc/src/auth_sspi.c +++ b/libtirpc/src/auth_sspi.c @@ -465,7 +465,7 @@ authsspi_refresh(AUTH *auth, void *tmp) if (call_stat != RPC_SUCCESS || (gr.gr_major != SEC_E_OK && gr.gr_major != SEC_I_CONTINUE_NEEDED)) - return FALSE; + break; if (gr.gr_ctx.length != 0) { #if 0 @@ -567,6 +567,7 @@ authsspi_destroy_context(AUTH *auth) log_debug("in authgss_destroy_context()"); gd = AUTH_PRIVATE(auth); + if (gd == NULL) return; if (SecIsValidHandle(&gd->ctx)) { if (gd->established) { @@ -601,6 +602,7 @@ authsspi_destroy(AUTH *auth) log_debug("in authgss_destroy()"); gd = AUTH_PRIVATE(auth); + if (gd == NULL) return; authsspi_destroy_context(auth);