summaryrefslogtreecommitdiffstats
path: root/src/lib/krb5
diff options
context:
space:
mode:
authorTheodore Tso <tytso@mit.edu>1992-09-29 13:48:05 +0000
committerTheodore Tso <tytso@mit.edu>1992-09-29 13:48:05 +0000
commit587a6b133471fa1e28dfaeea610bbf61acc3ee19 (patch)
tree8881294a903080a942b81ecc67980a4b0c31639e /src/lib/krb5
parentf16a10925ef099826daa44404ede2ac67693ee5f (diff)
downloadkrb5-587a6b133471fa1e28dfaeea610bbf61acc3ee19.tar.gz
krb5-587a6b133471fa1e28dfaeea610bbf61acc3ee19.tar.xz
krb5-587a6b133471fa1e28dfaeea610bbf61acc3ee19.zip
Change to alocate krb5_principal correctly
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@2418 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib/krb5')
-rw-r--r--src/lib/krb5/ccache/file/fcc_read.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/krb5/ccache/file/fcc_read.c b/src/lib/krb5/ccache/file/fcc_read.c
index b41ce1b9b5..660e41c69e 100644
--- a/src/lib/krb5/ccache/file/fcc_read.c
+++ b/src/lib/krb5/ccache/file/fcc_read.c
@@ -105,7 +105,7 @@ krb5_fcc_read_principal(id, princ)
tmpprinc = (krb5_principal) malloc(sizeof(krb5_principal_data));
if (tmpprinc == NULL)
return KRB5_CC_NOMEM;
- tmpprinc->data = malloc(length * sizeof(krb5_principal_data));
+ tmpprinc->data = (krb5_data *) malloc(length * sizeof(krb5_data));
if (tmpprinc->data == 0) {
free((char *)tmpprinc);
return KRB5_CC_NOMEM;
@@ -244,6 +244,10 @@ krb5_fcc_read_data(id, data)
}
data->data[data->length] = 0; /* Null terminate, just in case.... */
return KRB5_OK;
+ errout:
+ if (data->data)
+ xfree(data->data);
+ return kret;
}
krb5_error_code