From 64482ff6ab5a306c55d0cb7c1cec8d3ec413ef17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Mon, 30 Aug 2004 23:28:10 +0000 Subject: [PATCH] (krb5_get_init_creds): kdc_reply can be set in case of failure too, free unconditionally on exit to avoid memory leak git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@14179 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/krb5/init_creds_pw.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/krb5/init_creds_pw.c b/lib/krb5/init_creds_pw.c index b69397c8f..2b28bcc00 100644 --- a/lib/krb5/init_creds_pw.c +++ b/lib/krb5/init_creds_pw.c @@ -1433,10 +1433,10 @@ krb5_get_init_creds(krb5_context context, out: memset (buf, 0, sizeof(buf)); free_init_creds_ctx(context, &ctx); - if (ret == 0) { + krb5_free_kdc_rep (context, &kdc_reply); + if (ret == 0) *creds = ctx.cred; - krb5_free_kdc_rep (context, &kdc_reply); - } else + else krb5_free_cred_contents (context, &ctx.cred); return ret;