diff options
author | Tom Yu <tlyu@mit.edu> | 2006-09-25 20:52:38 +0000 |
---|---|---|
committer | Tom Yu <tlyu@mit.edu> | 2006-09-25 20:52:38 +0000 |
commit | 9ccafc76b9a8c2916b54819ce5ced9cf0c3ee1c9 (patch) | |
tree | fe03b9db488f8f4c05324002e6b4c4fc18c09e06 | |
parent | 1abed948899abb33a2edf1ce8e22492dee151cbc (diff) | |
download | krb5-9ccafc76b9a8c2916b54819ce5ced9cf0c3ee1c9.zip krb5-9ccafc76b9a8c2916b54819ce5ced9cf0c3ee1c9.tar.gz krb5-9ccafc76b9a8c2916b54819ce5ced9cf0c3ee1c9.tar.bz2 |
pull up r18600 from trunk
r18600@cathode-dark-space: jaltman | 2006-09-20 22:43:12 -0400
ticket: new
subject: windows thread support frees thread local storage after TlsSetValue
tags: pullup
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: 4305
version_fixed: 1.5.2
git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-5@18610 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(); } } |