diff options
author | Greg Hudson <ghudson@mit.edu> | 2008-11-03 19:47:40 +0000 |
---|---|---|
committer | Greg Hudson <ghudson@mit.edu> | 2008-11-03 19:47:40 +0000 |
commit | 05ca118e24833244cb7b51da82720448baf12c99 (patch) | |
tree | 7156c1b21d73640d87826ba0a1566a7149e5c1c8 /src/lib | |
parent | b093fb36e64edf461a560926b9cac9c4fc5a07d9 (diff) | |
download | krb5-05ca118e24833244cb7b51da82720448baf12c99.tar.gz krb5-05ca118e24833244cb7b51da82720448baf12c99.tar.xz krb5-05ca118e24833244cb7b51da82720448baf12c99.zip |
Apply a patch from Apple to correct a few memory leaks
ticket: 6201
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20958 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/kdb/kdb_default.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/lib/kdb/kdb_default.c b/src/lib/kdb/kdb_default.c index f7a855b729..78d06a300e 100644 --- a/src/lib/kdb/kdb_default.c +++ b/src/lib/kdb/kdb_default.c @@ -145,7 +145,7 @@ krb5_def_store_mkey(krb5_context context, char *tmp_ktname = NULL, *tmp_ktpath; krb5_data *realm = krb5_princ_realm(context, mname); #ifndef LEAN_CLIENT - krb5_keytab kt; + krb5_keytab kt = NULL; krb5_keytab_entry new_entry; #endif /* LEAN_CLIENT */ struct stat stb; @@ -226,6 +226,10 @@ krb5_def_store_mkey(krb5_context context, out: if (tmp_ktname != NULL) free(tmp_ktname); +#ifndef LEAN_CLIENT + if (kt) + krb5_kt_close(context, kt); +#endif return retval; } @@ -319,7 +323,7 @@ krb5_db_def_fetch_mkey_keytab(krb5_context context, krb5_kvno *kvno) { krb5_error_code retval = 0; - krb5_keytab kt; + krb5_keytab kt = NULL; krb5_keytab_entry kt_ent; krb5_enctype enctype = IGNORE_ENCTYPE; @@ -369,6 +373,9 @@ krb5_db_def_fetch_mkey_keytab(krb5_context context, } errout: + if (kt) + krb5_kt_close(context, kt); + return retval; } #endif /* LEAN_CLIENT */ |