From: Jeffrey Altman Date: Tue, 23 Jan 2007 01:18:17 +0000 (+0000) Subject: kt_file.c memory leak on error in krb5_kt_resolve / krb5_kt_wresolve X-Git-Tag: krb5-1.7-alpha1~1321 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=1353e0b780d643dad17f3437c3e0d610b20c95ca;p=krb5.git kt_file.c memory leak on error in krb5_kt_resolve / krb5_kt_wresolve The krb5_kt_resolve and krb5_kt_wresolve functions leak the 'data' memory allocation if the lock cannot be initialized. ticket: new tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19104 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; }