diff options
author | Jeffrey Altman <jaltman@secure-endpoints.com> | 2006-09-21 02:43:12 +0000 |
---|---|---|
committer | Jeffrey Altman <jaltman@secure-endpoints.com> | 2006-09-21 02:43:12 +0000 |
commit | e83127dee8e6994904b85f7b8b3a30b6238fec7c (patch) | |
tree | f643fcdbbf6fb6eeaf5d6202786e99ca28e73f9a | |
parent | 25860eac35980ab0d8d786fe1d06ced26a04d2db (diff) | |
download | krb5-e83127dee8e6994904b85f7b8b3a30b6238fec7c.zip krb5-e83127dee8e6994904b85f7b8b3a30b6238fec7c.tar.gz krb5-e83127dee8e6994904b85f7b8b3a30b6238fec7c.tar.bz2 |
windows thread support frees thread local storage after TlsSetValue
threads.c: The return value of TlsSetValue is non-zero on
success. As a result of misinterpreting the
return value, the memory set in TLS is then freed.
A subsequent call to TlsGetValue returns the
invalid pointer.
ticket: new
tags: pullup
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@18600 dc483132-0cff-0310-8789-dd5450dbe970
-rw-r--r-- | src/util/support/threads.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/util/support/threads.c b/src/util/support/threads.c index ebc1daf..7693cbb 100644 --- a/src/util/support/threads.c +++ b/src/util/support/threads.c @@ -275,9 +275,9 @@ int k5_setspecific (k5_key_t keynum, void *value) /* add to global linked list */ /* t->next = 0; */ err = TlsSetValue(tls_idx, t); - if (err) { + if (!err) { free(t); - return err; + return GetLastError(); } } |