Fix memory leak when not sending to master KDC in
authorSam Hartman <hartmans@mit.edu>
Thu, 15 Apr 2004 17:57:34 +0000 (17:57 +0000)
committerSam Hartman <hartmans@mit.edu>
Thu, 15 Apr 2004 17:57:34 +0000 (17:57 +0000)
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
src/lib/krb5/krb/gic_pwd.c

index 7e7a547edbdf9185a5e5c5b2e00615f7ab98329f..139cb5aca31d9f43c235ef1f6b277b6d765694f8 100644 (file)
@@ -1,3 +1,8 @@
+2004-04-15  Sam Hartman  <hartmans@mit.edu>
+
+       * 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 <kenh@cmf.nrl.navy.mil>
 
        * gic_keytab.c (krb5_get_in_tkt_with_keytab): Fix a case I missed
index 7689ab5c0cf428d60dc83421945c6e87ee6abe30..79f2e8540eabb144fdfb4951768dd36a17dfa809 100644 (file)
@@ -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,