diff options
| author | Theodore Tso <tytso@mit.edu> | 1994-09-23 01:39:18 +0000 |
|---|---|---|
| committer | Theodore Tso <tytso@mit.edu> | 1994-09-23 01:39:18 +0000 |
| commit | 955414824eb55c653811f522bcfe47fa8dd67d31 (patch) | |
| tree | 3142daeace3ad41fb3e026dddb53dd0d2836dfb4 /src/lib/krb5/ccache/file | |
| parent | 6729afae0b2c3d18853c0ff3d585c5f61d678a2c (diff) | |
Make sure memory associated the credentials cache is freed after the
cache is destroyed.
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4334 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib/krb5/ccache/file')
| -rw-r--r-- | src/lib/krb5/ccache/file/ChangeLog | 5 | ||||
| -rw-r--r-- | src/lib/krb5/ccache/file/fcc_destry.c | 19 |
2 files changed, 18 insertions, 6 deletions
diff --git a/src/lib/krb5/ccache/file/ChangeLog b/src/lib/krb5/ccache/file/ChangeLog index 97748b5d2..cc2628fba 100644 --- a/src/lib/krb5/ccache/file/ChangeLog +++ b/src/lib/krb5/ccache/file/ChangeLog @@ -1,3 +1,8 @@ +Thu Sep 22 21:37:15 1994 Theodore Y. Ts'o (tytso@dcl) + + * fcc_destry.c (krb5_fcc_destroy): Make sure memory associated + with the credentials cache is freed after it is destroyed. + Thu Aug 18 16:33:33 1994 Theodore Y. Ts'o (tytso at tsx-11) * fcc_retrv.c (srvname_match): Fix bug in srvname_match where so diff --git a/src/lib/krb5/ccache/file/fcc_destry.c b/src/lib/krb5/ccache/file/fcc_destry.c index be385c0af..1433346f8 100644 --- a/src/lib/krb5/ccache/file/fcc_destry.c +++ b/src/lib/krb5/ccache/file/fcc_destry.c @@ -45,8 +45,10 @@ krb5_error_code krb5_fcc_destroy(id) if (OPENCLOSE(id)) { ret = open(((krb5_fcc_data *) id->data)->filename, O_RDWR, 0); - if (ret < 0) - return krb5_fcc_interpret(errno); + if (ret < 0) { + ret = krb5_fcc_interpret(errno); + goto cleanup; + } ((krb5_fcc_data *) id->data)->fd = ret; } else @@ -59,7 +61,7 @@ krb5_error_code krb5_fcc_destroy(id) (void) close(((krb5_fcc_data *)id->data)->fd); ((krb5_fcc_data *) id->data)->fd = -1; } - return ret; + goto cleanup; } ret = fstat(((krb5_fcc_data *) id->data)->fd, &buf); @@ -69,7 +71,7 @@ krb5_error_code krb5_fcc_destroy(id) (void) close(((krb5_fcc_data *)id->data)->fd); ((krb5_fcc_data *) id->data)->fd = -1; } - return ret; + goto cleanup; } /* XXX This may not be legal XXX */ @@ -83,7 +85,7 @@ krb5_error_code krb5_fcc_destroy(id) (void) close(((krb5_fcc_data *)id->data)->fd); ((krb5_fcc_data *) id->data)->fd = -1; } - return ret; + goto cleanup; } if (write(((krb5_fcc_data *) id->data)->fd, zeros, size % BUFSIZ) < 0) { @@ -92,7 +94,7 @@ krb5_error_code krb5_fcc_destroy(id) (void) close(((krb5_fcc_data *)id->data)->fd); ((krb5_fcc_data *) id->data)->fd = -1; } - return ret; + goto cleanup; } ret = close(((krb5_fcc_data *) id->data)->fd); @@ -101,5 +103,10 @@ krb5_error_code krb5_fcc_destroy(id) if (ret) ret = krb5_fcc_interpret(errno); + cleanup: + xfree(((krb5_fcc_data *) id->data)->filename); + xfree(id->data); + xfree(id); + return ret; } |
