From: Tom Yu Date: Sat, 27 Jan 2007 02:07:08 +0000 (+0000) Subject: pull up r19104 from trunk X-Git-Tag: kfw-3.2.0-beta1~91 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=445eec9d83c2a09deea5f997abf57e1da9b53bee;p=krb5.git pull up r19104 from trunk r19104@cathode-dark-space: jaltman | 2007-01-22 20:18:17 -0500 ticket: new subject: kt_file.c memory leak on error in krb5_kt_resolve / krb5_kt_wresolve tags: pullup The krb5_kt_resolve and krb5_kt_wresolve functions leak the 'data' memory allocation if the lock cannot be initialized. ticket: 5410 version_fixed: 1.6.1 git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-6@19113 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/keytab/kt_file.c b/src/lib/krb5/keytab/kt_file.c index c31b90f34..92947d593 100644 --- a/src/lib/krb5/keytab/kt_file.c +++ b/src/lib/krb5/keytab/kt_file.c @@ -193,6 +193,7 @@ krb5_ktfile_resolve(krb5_context context, const char *name, krb5_keytab *id) err = k5_mutex_init(&data->lock); if (err) { + krb5_xfree(data); krb5_xfree(*id); return err; } @@ -791,6 +792,7 @@ krb5_ktfile_wresolve(krb5_context context, const char *name, krb5_keytab *id) err = k5_mutex_init(&data->lock); if (err) { + krb5_xfree(data); krb5_xfree(*id); return err; }