From 51424093a86bf4a9ef864d0749ac122e16fd8b0e Mon Sep 17 00:00:00 2001 From: Sam Hartman Date: Thu, 15 Apr 2004 17:57:34 +0000 Subject: [PATCH] Fix memory leak when not sending to master KDC in get_init_creds_password path. Ticket: 2534 Tags: pullup Target_Version: 1.3.4 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16255 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/krb/ChangeLog | 5 +++++ src/lib/krb5/krb/gic_pwd.c | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/src/lib/krb5/krb/ChangeLog b/src/lib/krb5/krb/ChangeLog index 7e7a547ed..139cb5aca 100644 --- a/src/lib/krb5/krb/ChangeLog +++ b/src/lib/krb5/krb/ChangeLog @@ -1,3 +1,8 @@ +2004-04-15 Sam Hartman + + * gic_pwd.c (krb5_get_init_creds_password): Free the as reply in + the !use_master case (Thanks to Lijian Liu) + 2004-03-09 Ken Hornstein * gic_keytab.c (krb5_get_in_tkt_with_keytab): Fix a case I missed diff --git a/src/lib/krb5/krb/gic_pwd.c b/src/lib/krb5/krb/gic_pwd.c index 7689ab5c0..79f2e8540 100644 --- a/src/lib/krb5/krb/gic_pwd.c +++ b/src/lib/krb5/krb/gic_pwd.c @@ -146,6 +146,10 @@ krb5_get_init_creds_password(krb5_context context, krb5_creds *creds, krb5_princ if (!use_master) { use_master = 1; + if (as_reply) { + krb5_free_kdc_rep( context, as_reply); + as_reply = NULL; + } ret2 = krb5_get_init_creds(context, creds, client, prompter, data, start_time, in_tkt_service, options, krb5_get_as_key_password, (void *) &pw0, -- 2.26.2