From: Tom Yu Date: Sat, 4 Dec 2004 01:42:57 +0000 (+0000) Subject: pullup from trunk X-Git-Tag: krb5-1.4.3-beta1~154 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=a6a0d2326a6829a9b2a0f495c216db15e96f950d;p=krb5.git pullup from trunk ticket: 2782 version_fixed: 1.4 git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-4@16911 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/keytab/ChangeLog b/src/lib/krb5/keytab/ChangeLog index 7e8186c6e..7907333e0 100644 --- a/src/lib/krb5/keytab/ChangeLog +++ b/src/lib/krb5/keytab/ChangeLog @@ -1,3 +1,7 @@ +2004-11-26 Ken Raeburn + + * kt_file.c (krb5_ktfile_wresolve): Initialize mutex here too. + 2004-11-23 Ken Raeburn * kt_file.c (struct _krb5_ktfile_data): Add mutex and buffer. diff --git a/src/lib/krb5/keytab/kt_file.c b/src/lib/krb5/keytab/kt_file.c index fc33af54a..6fb9f7b36 100644 --- a/src/lib/krb5/keytab/kt_file.c +++ b/src/lib/krb5/keytab/kt_file.c @@ -793,6 +793,7 @@ krb5_error_code KRB5_CALLCONV krb5_ktfile_wresolve(krb5_context context, const char *name, krb5_keytab *id) { krb5_ktfile_data *data; + krb5_error_code err; if ((*id = (krb5_keytab) malloc(sizeof(**id))) == NULL) return(ENOMEM); @@ -803,7 +804,14 @@ krb5_ktfile_wresolve(krb5_context context, const char *name, krb5_keytab *id) return(ENOMEM); } + err = k5_mutex_init(&data->lock); + if (err) { + krb5_xfree(*id); + return err; + } + if ((data->name = (char *)calloc(strlen(name) + 1, sizeof(char))) == NULL) { + k5_mutex_destroy(&data->lock); krb5_xfree(data); krb5_xfree(*id); return(ENOMEM);