From 33ebb4bee57603288c37aa7f02a923b3d2804382 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 6 May 2004 18:23:01 +0000 Subject: r527: More memory leak fixes in error paths from kawasa_r@itg.hitachi.co.jp. Jeremy. (This used to be commit b2ba4d5c1be6089e3818a20c68e3894432b53d87) --- source3/libsmb/clikrb5.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/source3/libsmb/clikrb5.c b/source3/libsmb/clikrb5.c index 81797a7bfc0..e688ad608cd 100644 --- a/source3/libsmb/clikrb5.c +++ b/source3/libsmb/clikrb5.c @@ -359,8 +359,8 @@ int cli_krb5_get_ticket(const char *principal, time_t time_offset, { krb5_error_code retval; krb5_data packet; - krb5_ccache ccdef; krb5_context context; + krb5_ccache ccdef = NULL; krb5_auth_context auth_context = NULL; krb5_enctype enc_types[] = { #ifdef ENCTYPE_ARCFOUR_HMAC @@ -411,8 +411,14 @@ int cli_krb5_get_ticket(const char *principal, time_t time_offset, #endif failed: - if ( context ) + + if ( context ) { + if (ccdef) + krb5_cc_close(context, ccdef); + if (auth_context) + krb5_auth_con_free(context, auth_context); krb5_free_context(context); + } return retval; } -- cgit